Current location - Training Enrollment Network - Mathematics courses - What's the difference between'1','1'and'1'in C language? How are they stored in memory?
What's the difference between'1','1'and'1'in C language? How are they stored in memory?
1' is a character.

1 is an integer 1.

"1" is a string. 1

Under normal circumstances

1' is a character, so it takes up one byte of memory.

1 is an integer, so it needs 4 bytes of memory.

1' is a string, that is, an array of characters, but the string needs a \ 0; So you need two bytes of memory.