Q
Quick Function
What does it mean:
int (*a)[10];
int (*a)[10];
Quick Function said:What does it mean:
int (*a)[10];
What does it mean:
int (*a)[10];
int (*a)[10];
'a' points to an array of 10 intergers:
Gernot Frisch said:int (*a)[10];
'a' points to an array of 10 intergers:
At least eleven? [0...10]
for ( int i = 0; i < 10; ++i ) std::cerr << array << '\n';
}
Rob.
10.5 : you can point at [10] but not access it.Mabden said:Gernot Frisch said:int (*a)[10];
'a' points to an array of 10 intergers:
At least eleven? [0...10]
Nope. 0..9
pvsp said:for ( int i = 0; i < 10; ++i ) std::cerr << array << '\n';
}
Rob.
sorry, it isn't on topic;
what is difference between cerr and cout ??
thanks,
for ( int i = 0; i < 10; ++i ) std::cerr << array << '\n';
}
Rob.
sorry, it isn't on topic;
what is difference between cerr and cout ??
thanks,
Richard Herring said:10.5 : you can point at [10] but not access it.Mabden said:Gernot Frisch said:int (*a)[10];
'a' points to an array of 10 intergers:
At least eleven? [0...10]
Nope. 0..9
Gernot said:Richard Herring said:10.5 : you can point at [10] but not access it.Mabden said:int (*a)[10];
'a' points to an array of 10 intergers:
At least eleven? [0...10]
Nope. 0..9
In a release version you can even access it.
You can, but it is undefined behaviour. Just the same
as you would access [11], [12], [13], [14], etc ...
Gernot said:In a release version you can even access it.
You can, but it is undefined behaviour. Just the same
as you would access [11], [12], [13], [14], etc ...
That's why I'd only try reading - it if at all... )
In a release version you can even access it.
You can, but it is undefined behaviour. Just the same
as you would access [11], [12], [13], [14], etc ...
That's why I'd only try reading - it if at all... )
Reading is still access and therefore UB.Gernot Frisch said:In a release version you can even access it.
You can, but it is undefined behaviour. Just the same
as you would access [11], [12], [13], [14], etc ...
That's why I'd only try reading - it if at all... )
Rob Williscroft said:However std::cerr, differs from std::cout in that every time a '\n' char
is sent to it, it calls flush(), so the output should be immediatly
visible (or writen to the file if its been redirected).,
Actually, cerr has unitbuf set. Every output operation is flushed.
There is no "linebuffering" mode defined in C++ although some
non-unibuf stream implementations work that way on terminals.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.