September 1998
Intermediate to advanced
848 pages
20h 13m
English
A character string is a series of one or more characters. Here is an example of a string:
"Zing went the strings of my heart!"
The double quotation marks are not part of the string. They inform the compiler that they enclose a string, just as single quotation marks identify a character.
C has no special variable type for strings. Instead, strings are stored in an array of type char. Characters in a string are stored in adjacent memory cells, one character per cell, and an array consists of adjacent memory locations, so placing a string in an array is quite natural (see Figure 4.1).
Note that Figure 4.1 shows the character \0 in ...
Read now
Unlock full access