Traditional Culture Encyclopedia - Traditional culture - char a = ' abcd
char a = ' abcd
In C, there is no essential difference between characters and integers. Char can be regarded as an integer of 1 byte, short as a 2-byte wide character, and int as a 4-byte wide character.
Therefore, "A" means the character "A", "ab" means a 2-byte integer or a wide character, and "abcd" means a 4-byte integer or a wide character. But only 1 byte, 2 bytes and 4 bytes are supported.
Char c =' a// Of course it is.
Char c =' ab// is equivalent to the integer char c=0x6 162. Because the' a' character means 0x6 1 and the' b' character means 0x62. But because' ab' is 2 bytes, it will give an integer truncation warning when it is assigned to char.
Char c =' abc// is equivalent to the integer char c=0x006 16263, and a warning will also be given.
Char c =' abcd// is equivalent to the integer char c=0x6 1626364, and a warning will also be given.
Char c =' abcde// exceeds the maximum integer byte length of 4. Error handling
- Related articles
- How to eat rice fish
- Which sports brands are expected to overtake Adi and Nike?
- Why are there Mid-Autumn Festival and Mid-Autumn Festival written? What do Mid-Autumn Festival and Mid-Autumn Festival mean respectively?
- Creative small store business plan
- Hangzhou notary public fees
- There is an animated cartoon in which the main character travels from the time of the Yellow Emperor and brings with him a divine beast.
- Tesla Model 3 became the best-selling model in 19 country, subverting the fuel vehicle market.
- What is the meaning of project financing and what are its characteristics?
- How to write words for Chongyang Festival
- Simple and homely practice of braised pork feet?