The value of '0' equals to 48 ASCII codes, and the value of 0 equals to 0 without quotation marks.

Source: Internet
Author: User
'\ 0' is not an ascii code value. It is a character and its ASCII value is 0.
‘\0‘==0

0 digit 48
The space ASCII code value is 32.
 
main()
{
char a=‘\0‘;

if(a==0) printf("A ASCII is 0\n");

if(a==‘ ‘) printf("A is space\n");

printf("*%c*\n",a);

getch();
}
 





Single quotes are characters
Double quotation marks are strings
No number is added.


Single quotes indicate zero characters, that is, char type '0' and zero characters
The zero value without quotation marks indicates that the int Type 0 is zero.


In a computer, all data is stored and computed in binary notation,
Likewise, 52 letters (including uppercase letters), numbers such as A, B, C, and D, and numbers such as 0, 1, and 2
There are also some commonly used symbols (such as *, #, @, and so on) stored in a computer, which must also be represented by binary numbers,

And the specific number used to represent which symbol, of course, everyone can agree on their own set (this is called encoding), and if you want to communicate with each other without causing confusion,
Then everyone must use the same encoding rules, so the relevant standardization organizations in the United States issued the so-called American Information Exchange Standard code, which uniformly specifies which binary number is used for the above commonly used symbols. */



Char;
Int I;
Cin>;
I =;
Cout <I; then youInput 0You do not need to add single quotes.The output is 48.






Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.