what is the difference ...?
-
The first one outputs a asterix because the double quotes denotes a char array, the second one is a little trickier because you are using a single quote to wrap two bytes. That means that the operator << is outputting a short (two bytes) instead of a char (one byte). Try this
cout << "asdf" << endl;
cout << 'asdf' << endl;and you get the same type of result.
You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it! -- modified at 17:48 Thursday 23rd March, 2006
-
The first one outputs a asterix because the double quotes denotes a char array, the second one is a little trickier because you are using a single quote to wrap two bytes. That means that the operator << is outputting a short (two bytes) instead of a char (one byte). Try this
cout << "asdf" << endl;
cout << 'asdf' << endl;and you get the same type of result.
You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it! -- modified at 17:48 Thursday 23rd March, 2006