HELLO.CPP—Your First C++ Program

Traditional programming books begin by writing the words Hello World to the screen, or a variation on that statement. This time-honored tradition is carried on here.

For the Dev-C++ IDE, click New Source file to bring up the editor.

Type the first program directly into the editor, exactly as shown. After you are certain it is correct, save the file, naming it Hello.cpp, compile it, link it if your compiler does not do so automatically, and then run it. It will display the words Hello World on your screen. Don't worry too much about how it works; this is really just to get you comfortable with the development cycle ...

Get Sams Teach Yourself C++ in 24 Hours, Third 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.