Strings
suggest changeIntroduction
In C, a string is not an intrinsic type. A C-string is the convention to have a one-dimensional array of characters which is terminated by a null-character, by a '\0'
.
This means that a C-string with a content of "abc"
will have four characters 'a'
, 'b'
, 'c'
and '\0'
.
See the basic introduction to strings example.
Syntax
- char str1[] = “Hello, world!”; /* Modifiable */
- char str2[14] = “Hello, world!”; /* Modifiable */
- char* str3 = “Hello, world!”; /* Non-modifiable*/
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents