cpp

References

Summary

An object-oriented language

A compiled language

Has flexibile memory management

Pointed chasing and virtual method look-up slow down C++ in comparison to Fortran

Compilation

Because C++ isn't an interpretted language, it needs to be compiled before it can be executed

Headers

<iostream>

Used for the program to know about input and output cout is console output

<string>

getline

Statements

These are the instructions in the program They all end with a semicolon

Variables

Must be declared with a type

Double-type variables use up a lot more memory than int

Int is signed by default

Type Conversion

Explicit type conversion changes the type of a variable

Debugging

C++ has some features to aid in debugging your program

<cassert>

assert will check whether a particular statement is true, and if not, it will exit the program, pointing to the issue

asserts are automatically removed when compiled with the -O flag, to optimize your code, which is awesome — once you know it works, you can drop the asserts