can u tell me the diffrence b/w
char a='1';
and
char a=1;
and can u tell me wht it means
int i = 0x1234567
thank u
sree
can u tell me the diffrence b/w
char a='1';
and
char a=1;
and can u tell me wht it means
int i = 0x1234567
thank u
sree
Print them both and find out?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
In ASCII, '1' has the value of 49.can u tell me the diffrence b/w
char a='1';
and
char a=1;
The 0x prefix specifies that the number is expressed in hexadecimal, i.e., 0x1234567 == 19088743.and can u tell me wht it means
int i = 0x1234567
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Code:char a='1'; printf("%c",a); //prints 1Code:char a=1; printf("%c",a); //prints character with ASCII value 1
It is not a garbage value. It so happens that the char with value 1 is not printable.char a=1--> it will give garbage value
You are mistaken. 0X1234567 is just an int literal.int i=0X1234567-->Storing address directly into varible i
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)