Surprise in C lines, NULL, spaces

In C, can I say that the space in the string is of type NULL or something else?
In C, which character represents the end of a string?

+5
source share
4 answers

a null character (ASCII value 0, '\0'as a character literal) terminates a string in C. This character is usually not considered a space character.

The space in the middle of this line, for example: "Hello world"is a character with an ASCII value of 32. This is not the same as NULL or \0.

+15
source

In C, can I say that the space in the string is of type NULL or something else?

, NULL. .

C, ?

'\0' .

+3

"" , isspace() :

  • space (ASCII 0x32, C literal ' ')
  • (ASCII 0x09, C literal '\t')
  • (ASCII 0x0B, C literal '\v')
  • form feed (ASCII 0x0C, C literal '\f')
  • (ASCII 0x0E, C literal '\r')
  • newline (ASCII 0x0A, C literal '\n')

- ASCII NUL (0x00); , .

+3

- 0. , '\0'.

Your first NULL type space question makes no sense.

0
source

All Articles