1 2 3 4 5 6 7 8 9 10 11 12

Note that in C the char data type only determines the size
of memory allocated, but is otherwise like an 8-bit
unsigned int.


In C++, a char remains as a char until it is used in a
nontrivial expression, which then forces it to an int.


In both C and C++ there is no difference between a pointer
to a character and a pointer to a string of characters.
There are differences in handling i/o of strings.
char* string = "nothing but words";
cout << string;
would do what you expect, but


char s[100];
cin >> s;
would, upon reading the sequence:
nothing but words
would yield s = "nothing";


Thus the first blank on input is a data field separator!
Also C++ output is buffered, so output to the screen must
be forced with the
flush; function.


Tags versus type names
In C++ tags (names identifying a particular kind of
structure, union or enumeration) are automatically type
names
C:
typedefstruct { double real, imag } Complex;
C++
struct Complex{ double real, imag };

March 2,1998

Page 8

C201 TAM/AGS