EXPLORATION 6

image

Error Messages

By now you’ve seen plenty of error messages from your C++ compiler. No doubt, some are helpful and others are cryptic—a few are both. This Exploration presents a number of common errors and gives you a chance to see what kinds of messages your compiler issues for these mistakes. The more familiar you are with these messages, the easier it will be for you to interpret them in the future.

Read through Listing 6-1 and keep an eye out for mistakes.

Listing 6-1.  Deliberate Errors

 1 #include <iosteam> 2 // Look for errors 3 int main() 4 [ 5   std::cout < "This program prints a table of squares.\n"; 6          "Enter ...

Get Exploring C++ 11, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.