F
Frederick Gotham
Pete Becker posted:
Signed char may trap in C (it may also contain padding).
Signed char may NOT contain padding in C++ (although I'm not certain if it
can trap or not -- you never get a clear answer.)
Phlip said:Jim Langston wrote:
On my system I tried this:
int* MyArray = new int[10];
std::cout << MyArray[0] << std::endl;
Just a note: The act of rvalue-ing an uninitialized integer is undefined.
(Question: Is this defined?
char f;
assert(0 == f || 0 != f);
I know it's undefined for 'int f'.)
In C it's undefined when f is an int, but well defined when f is any
flavor of char.
Signed char may trap in C (it may also contain padding).
Signed char may NOT contain padding in C++ (although I'm not certain if it
can trap or not -- you never get a clear answer.)