11.07.2015 Views

tYSR20

tYSR20

tYSR20

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 1: Writing Your First C++ Program 19Figure 1-7:The user isrewardedwith asimple Donemessage ifhis programis error free.Dev-C++ generates a message if it finds any type of error in your C++ program —and coding errors are about as common as snow in Alaska. You’ll undoubtedlyencounter numerous warnings and error messages, probably even when enteringthe simple Conversion.cpp. To demonstrate the error-reporting process,let’s change Line 17 from cin >> celsius; to cin >>> celsius;.This seems an innocent enough offense — forgivable to you and me perhaps,but not to C++. Dev-C++ opens a Compiler tab, as shown in Figure 1-8. The messageparse error before ‘> is perhaps a little terse, but descriptive. To getrid of the message, remove the extra > and recompile.Figure 1-8:Bad littleprogramsgenerateerrormessages inthe Compilerwindow.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!