Introduction to C++

2020 Spring course data

Requirements

Literature

Books

Online references

Week 1

  1. The stories of numbers, computing machines, computer languages
  2. The scheme of a digital computer: CPU, memory, I/O devices, peripherials, operation systems
  3. Algorithms, algorithmization, functions as bookbinderies
  4. Text editors (Notepad++, Vim, Emacs, Geany), file system tree, terminals, executables
  5. C++ installation on Windows MinGW, Linux GNU and virtual machines
  6. Integrated development environments (IDE), Code::Blocks

Week 2

Preprocessing, compiling, linking, executing

Compiler errors and warnings

unterminated comment
You left out a semicolon at the end of a statement.

parse error before <something>
Probably a missing semicolon or brace before an element, though it could be something else.

syntax error before <something>
You tried to use an operator or keyword that doesn't belong there. Alternatively, you might have mispelled something (remember that C++ is case sensitive).

missing terminating " character
You left out the terminating double-quotes of a string literal.

cout undeclared (first use this function)
You forgot to put #include <iostream> at the top of your source file.

warning: multi-line string literals are deprecated
You did something like this:

Variables and types

GroupType namesNotes on size / precision
Character typescharExactly one byte in size. At least 8 bits.
 char16_tNot smaller than char. At least 16 bits.
 char32_tNot smaller than char16_t. At least 32 bits.
 wchar_tCan represent the largest supported character set.
Integer types (signed)signed charSame size as char. At least 8 bits.
 signed short intNot smaller than char. At least 16 bits.
 signed intNot smaller than short. At least 16 bits.
 signed long intNot smaller than int. At least 32 bits.
 signed long long intNot smaller than long. At least 64 bits.
Integer types (unsigned)unsigned char(same size as their signed counterparts)
 unsigned short int 
 unsigned int 
 unsigned long int 
 unsigned long long int 
Floating-point typesfloat 
 doublePrecision not less than float
 long doublePrecision not less than double
Boolean typebool 
Void typevoidno storage
Null pointerdecltype(nullptr)