PrintNumber ErrorLocation Error Correction DateAdded
1 p iv First printing: October 2011 Second printing: January 2012 11/29/2011
1 p 2 • It provides a variety of sidebars, including tips, cautions, things to remember, compatibility notes, and real-world notes. • It provides a variety of sidebars, including tips, cautions and notes. 1/5/2012
1 p 18 Contemporary compilers provide good support for C++98. Some compilers at the time of this writing also support some C++11 features, and we can expect the level of support to increase quickly after the new standard is adopted. This book reflects the current situation, covering C++98 pretty thoroughly and introducing several C++11 features. Some of these features are integrated with the coverage of related C++98 topics. Chapter 18, “Visiting with the New C++ Standard,” concentrates on the new features, summarizing the ones mentioned earlier in the book and presenting additional features. Contemporary compilers provide good support for C++98. Some compilers at the time of this writing also support some C++11 features, and we can expect the level of support to increase quickly now that the new standard is adopted. This book reflects the current situation, covering C++98 pretty thoroughly and introducing several C++11 features. Some of these features are integrated with the coverage of related C++98 topics. Chapter 18, “Visiting with the New C++ Standard,” concentrates on the new features, summarizing the ones mentioned earlier in the book and presenting additional features. 1/5/2012
1 p 19 Most of the programs in this book are generic and should run in any system that supports C++98. However, some, particularly those in Chapter 18, do require some C++11 support. At the time of this writing, some compilers require additional flags to activate their partial C++11 support. For instance, g++, beginning with version 4.3, currently uses the –std=c++11 flag when compiling a source code file:
g++ -std=c++11 use_auto.cpp
Most of the programs in this book are generic and should run in any system that supports C++98. However, some, particularly those in Chapter 18, do require some C++11 support. At the time of this writing, some compilers require additional flags to activate their partial C++11 support. For instance, g++, beginning with version 4.3, currently uses the –std=c++0x flag when compiling a source code file:
g++ -std=c++0x use_auto.cpp
1/5/2012
1 p 71 Note
If your system doesn’t support the long_long type, you should remove the lines using that type.
Note
If your system doesn’t support the long long type, you should remove the lines using that type.
1/5/2012
1 p 90 uses the U prefix for char32_t constants, as in U'R' and U"dirty rat". The char16_t type is a natural match for universal character names of the form /u00F6, and the char32_t type is a natural match for universal character names of the form /U0000222B. The prefixes u and U are used to indicate character literals of types char16_t and char32_t, respectively:
char16_t ch1 = u'q'; // basic character in 16-bit form
char32_t ch2 = U'/U0000222B'; // universal character name in 32-bit form
uses the U prefix for char32_t constants, as in U'R' and U"dirty rat". The char16_t type is a natural match for universal character names of the form \u00F6, and the char32_t type is a natural match for universal character names of the form \U0000222B. The prefixes u and U are used to indicate character literals of types char16_t and char32_t, respectively:
char16_t ch1 = u'q'; // basic character in 16-bit form
char32_t ch2 = U'\U0000222B'; // universal character name in 32-bit form
1/5/2012
1 p 92 Now that you have seen the complete line of C++ integer types, let’s look at the floating-point types, which compose the second major group of fundamental C++ types. These numbers let you represent numbers with fractional parts, such as the gas mileage of an M1 tank (0.56 MPG). They also provide a much greater range in values. If a number is too large to be represented as type long—for example, the number of bacterial cells in a human body (estimated to be greater than 100,000,000,000)—you can use one of the floating-point types. Now that you have seen the complete line of C++ integer types, let’s look at the floating-point types, which compose the second major group of fundamental C++ types. These numbers let you represent numbers with fractional parts, such as the gas mileage of an M1 tank (0.56 MPG). They also provide a much greater range in values. If a number is too large to be represented as type long—for example, the number of bacterial cells in a human body (estimated to be greater than 100,000,000,000,000)—you can use one of the floating-point types. 1/5/2012
1 p 94 Like ANSI C, C++ has three floating-point types: float, double, and long double. These types are described in terms of the number of significant figures they can represent and the minimum allowable range of exponents. Significant figures are the meaningful digits in a number. For example, writing the height of Mt. Shasta in California as 14,162 feet uses five significant figures, for it specifies the height to the nearest foot. Like ANSI C, C++ has three floating-point types: float, double, and long double. These types are described in terms of the number of significant figures they can represent and the minimum allowable range of exponents. Significant figures are the meaningful digits in a number. For example, writing the height of Mt. Shasta in California as 14,179 feet uses five significant figures, for it specifies the height to the nearest foot. 1/5/2012
1 p 139 But the raw string syntax allows you to place additional characters between the opening " and (. This implies that the same additional characters must appear between the final ) and ". So a raw string beginning with R"+* must terminate with )+*". Thus, the statement But the raw string syntax allows you to place additional characters between the opening " and (. This implies that the same additional characters must appear between the final ) and ". So a raw string beginning with R"+* ( must terminate with )+*". Thus, the statement 1/5/2012
1 p 192 17. Declare a vector object of 10 string objects and an array object of 10 string objects. Show the necessary header files and don’t use using. Do use a const for the number of strings. 17. Declare a vector object of 10 string objects and an array object of 10 string objects. Show the necessary header files and don’t use using. Do use a const for the number of strings. 1/5/2012
1 p 221 for (ch = ‘a’; ch <= ‘z’; ch++)
cout << ch;
for (ch = ‘a’; ch <= ‘z’; ch++)
cout << ch;
1/6/2012
1 p 222 for (char ch = ‘a’; strcmp(word, "mate"); ch++) for (char ch = ‘a’; strcmp(word, "mate"); ch++) 1/6/2012
1 p 224 for (char ch = ‘a’; word != "mate"; ch++) for (char ch = ‘a’; word != "mate"; ch++) 1/6/2012
1 p 226 while (name[i] != ‘\0’) // process to end of string while (name[i] != ‘\0’) // process to end of string 1/6/2012
1 p 228 while (name[i] != ‘\0’) while (name[i] != ‘\0’) 1/6/2012
1 p 233 cout << ‘\n’; cout << ‘\n’; 1/6/2012
1 p 234 while (ch != ‘#’) // test the character while (ch != ‘#’) // test the character 1/6/2012
1 p 236 while (ch != ‘#’) while (ch != ‘#’) 1/6/2012
1 p 291 Enter the make and model of automobile: Flitz Perky
Enter the model year: 2009
Enter the original asking price: 13500
Enter the make and model of automobile: Flitz Perky
Enter the model year: 2009
Enter the original asking price: 13500
1/9/2012
1 p 385 is, in essence, a disguised notation for something like this: is, in essence, a disguised notation for something like this: 1/9/2012
1 p 387 Change instances of times, x and 20 in figure 8.2 to mono font, not intalics. Done 1/9/2012
1 p 478 int * pa = new int{40]; int * pa = new int[40]; 1/9/2012