C-strings

From Tux
Revision as of 13:27, 27 January 2018 by Williams (talk | contribs) (Created page with "'''C-strings''' are <code>char</code> arrays that end in the '''null terminator''' (<code>NULL</code>, <code>0</code>, or <code>'\0'</code>). Pre-defined functions in C and C...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

C-strings are char arrays that end in the null terminator (NULL, 0, or '\0'). Pre-defined functions in C and C++ contain logic such that, even if a character array is very large, processing of that array stops when the null terminator is reached.

To convert a C++ string into a C-string, use the string.c_str() function.