Navigation



B.1 — Introduction to C++11

What is C++11?

On August 12, 2011, the ISO (International Organization for Standardization) approved a new version of C++, called C++11. C++11 adds a whole new set of features to the C++ language! Use of these new features is entirely optional — but you will undoubtedly find some of them helpful. We will only . . . → Read More: B.1 — Introduction to C++11

A.6 — Fixed-width integers

Fixed width integers

The C99 standard defines a set of integer types that have predetermined sizes, so you don’t have to worry about the size of an integer changing if you move to another platform.

The fixed width integer types defined in C99 are named as follows:

Name Type int8_t 1 byte signed uint8_t . . . → Read More: A.6 — Fixed-width integers

16.1 — The Standard Template Library (STL)

Congratulations! You made it all the way through the primary portion of the tutorial! In the preceding lessons, we covered all the principal C++ language features (excluding those in the C++11 extension to the language).

So the obvious question is, “what next?”. One thing you’ve probably noticed is that an awful lot of programs . . . → Read More: 16.1 — The Standard Template Library (STL)

17.7 — std::string inserting

Inserting

Inserting characters into an existing string can be done via the insert() function.

string& string::insert (size_type index, const string& str) string& string::insert (size_type index, const char* str)

Both functions insert the characters of str into the string at index Both function return *this so they can be “chained”. Both functions throw out_of_range if . . . → Read More: 17.7 — std::string inserting

17.6 — std::string appending

Appending

Appending strings to the end of an existing string is easy using either operator+=, append(), or push_back() function.

string& string::operator+= (const string& str) string& string::append (const string& str)

Both functions append the characters of str to the string. Both function return *this so they can be “chained”. Both functions throw a length_error . . . → Read More: 17.6 — std::string appending