Pointers, Arrays, and Strings

C++ has a string class, but the C-Language does not.

Understanding C-style strings is important, even if you plan to use the string class.

C-style strings are arrays of characters (char).

C-style strings must adhere to this rule: everything that process a C-style string knows to process it character-by-character until the EOS ('\0') character.

In C/C++ arrays are related to pointers, so we will need a brief introduction.

The C++ string Class

Note: C/C++ has the same concept of primitives we saw in Java, such as int, char, double, ...; like Java, they do not have constructors and will not be used with dot-notation.

Pointers

Pointers and Arrays

Arrays of Characters