explain this statement

Sep 13, 2012 at 1:31am
cout<<32;
in this statement,is 32 being stored first and after this it is being printed on the screen?.am asking this question because,if we use a statement sizeof(32) we get 32= 2 bytes.
Sep 13, 2012 at 2:03am
cout is an ostream which has an << operator for formating integers, so 32 is passed as an argument to the operator << function in the same way as you pass an integer to any other function, so 32 is "stored" on the stack as part of the function call.
Sep 13, 2012 at 2:28am
so, thats why sizeof(32) =2 bytes?
Sep 13, 2012 at 6:35am
32 is a short integer, which is 2 bytes in length.

http://www.cplusplus.com/doc/tutorial/variables/
Sep 13, 2012 at 9:47am
32 - is an integral constant of type int (not short int as it was said above) . So it means that 2 is sizeof( int ) on your system
Sep 13, 2012 at 2:38pm
because 32 is a integer in a C++ computer language integer requires two bytes
Topic archived. No new replies allowed.