Code ASCII of \0

houda LR Posted messages 11 Status Member -  
 code ascii -
Hello everyone,
I would like to know the ASCII code for the end of string character: \0,
because I am having problems with my program,
thank you very much,

2 answers

[Dal] Posted messages 6122 Registration date   Status Contributor Last intervention   1 108
 
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
5