9.3 — Lvalue references

In C++, a is an alias for an existing object. Once a reference has been defined, any operation on the reference is applied to the object being referenced. Key insight A reference is essentially identical to the object being referenced. This means we can use a reference to read or …

11.6 — C-style strings

In lesson , we defined a string as a collection of sequential characters, such as “Hello, world!”. Strings are the primary way in which we work with text in C++, and std::string makes working with strings in C++ easy. Modern C++ supports two different types of strings: std::string (as part …