[prev] 63 [next]

Strings

"String" is a special word for an array of characters
  • end-of-string is denoted by '\0' (of type char and always implemented as 0)
Example:

If a character array s[11] contains the string "hello", this is how it would look in memory:

  0   1   2   3   4   5   6   7   8   9   10
---------------------------------------------
| h | e | l | l | o | \0|   |   |   |   |   |
---------------------------------------------