O'Reilly logo

Sams Teach Yourself C++ in 24 Hours, Third Edition by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required