xvi Preface
• Chapter 2 also introduces the new long long i nt and unsigned long long i nt
data types and the
LL literal suffix.
• Chapter 5 shows how to pass a str i ng object directly to a file stream object's
open member function, without the need to call the c_st r () member function.
A discussion of the c_s t r () function sti ll exists for anyone using a legacy
compiler.
• The range -based for loop is introduced in Chapter 7. Thi s new looping
mechanism automatically iterates over each element of an array, vector, or
other collection, without the need for a counter variable or a subscript.
• Chapter 7 also introduces strongly typed enums.
• Chapter 8 introduces new ways to initialize variables and shows how a vect or
can now be initialized with an initialization list.
• Chapter 10 introduces smart pointers and provides examples of how and why to use
the new uni que_ptr and shared_ptr pointers for safely allocating and working
with dynamic memory.
• Chapter 10 also introduces the move assignment operator, and the null pt r key
word, which is now the standard way of representing a null pointer.
• Chapter 11 discusses move constructors, provides more in depth coverage of
move assignment operators, and introduces lambda expressions .
• Chapter 12 introduces new functions in the C++ 11 string library and discusses
the new overloaded to _stri ng functions for convert ing numeric values to stri ng
objects.
• Chapter 15 introduces and demonstrates the use of the new override key word
that helps prevent subtle overridin g errors and the new final key word that
prevents a virtua l member function from being overridden .
• Chapter 16 introduces the new C++ 11 functions begi n ( c) and end ( c) to specify
positions within a collection c where an operat ion should begin and end.
What Else is New
This book's pedagogy and clear writing style remain the same as in the previous edition.
However, in addition to updating the book to introduce the new C++l 1 standard,
many improvements have been made to make it even more student -friendly.
• Upd ated Material
Material has been updated throughout the book to reflect changes in technology
and in software development environments, as well as to improve clarity and
incorporate best practices in teaching introductory programming . As a result,
new graphics and new or redesigned figures have been added throughout the
book where appropriate and new or impr oved sample programs have been
included in a number of chapters .
• New Material
New materia l has been added on a number of topics. In addition to introducing
and using new C++ 11 features, this new edition includes new sections on literals,
random numbers, and enumerated data types, as well as improved materia l on
designing classes.