Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wondering in C strings, NULL, white spaces

In C, can I say a white space in a string has a NULL type, or something else?
In C, which character represents the termination of a string?

like image 304
Rn2dy Avatar asked Sep 12 '10 19:09

Rn2dy


1 Answers

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

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

like image 151
Mark Byers Avatar answered Dec 14 '22 04:12

Mark Byers