O'Reilly logo

Discovering Modern C++: An Intensive Course for Scientists, Engineers, and Programmers by Peter Gottschling

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

Chapter 1. C++ Basics

“To my children: Never make fun of having to help me with computer stuff. I taught you how to use a spoon.”

—Sue Fitzmaurice

In this first chapter, we will guide you through the fundamental features of C++. As for the entire book, we will look at it from different angles but we will not try to expose every possible detail—which is not feasible anyway. For more detailed questions on specific features, we recommend the online manuals http://www.cplusplus.com/ and http://en.cppreference.com.

1.1 Our First Program

As an introduction to the C++ language, let us look at the following example:

#include <iostream>int main (){    std::cout "The answer to the Ultimate Question of Life,\n"               ...

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