2 answers
Hello Houda LR,
The standard defines that a multiplet (an octet on our machines) with all bits set to zero is called the "null" character, that it must exist in the character set in which the program runs, and that it is used to terminate a literal string. The "null" character must therefore have a code value of zero.
'\0' is the usual representation of the "null" character.
In the ASCII character set, the ASCII code for the "null" character is indeed 0 (zero).
https://www.commentcamarche.net/informatique/technologies/1589-code-ascii/
However, in C, it is usually referred to as '\0' rather than as 0 to indicate that it is a character.
Dal
The standard defines that a multiplet (an octet on our machines) with all bits set to zero is called the "null" character, that it must exist in the character set in which the program runs, and that it is used to terminate a literal string. The "null" character must therefore have a code value of zero.
'\0' is the usual representation of the "null" character.
In the ASCII character set, the ASCII code for the "null" character is indeed 0 (zero).
https://www.commentcamarche.net/informatique/technologies/1589-code-ascii/
However, in C, it is usually referred to as '\0' rather than as 0 to indicate that it is a character.
Dal