Strictly this is an escape sequence for a character with an octal value of zero (which, of course, is also zero in any database).
Although you can use any number with a zero prefix to indicate an octal character code (for example, '\040' is an ASCII character space), you rarely have to. '\ 0' is idiomatic for specifying a NUL character (because you cannot enter such a character from the keyboard or display it in your editor).
You can also specify "\ x0", which is the NUL character expressed in hexadecimal format.
The NUL character is used in C and C ++ to end a string stored in an array of characters. This view is used for string string constants and conditionally for strings that are managed by the <cstring> / <string.h> library. In C ++, you can use the std :: string class instead.
Note that in C ++, a character constant such as '\0' or 'a' is of type char . In C, perhaps for unclear reasons, it is of type int .
Clifford
source share