C++ is a powerful general-purpose programming language designed for building efficient, high-performance software. It can be used to develop operating systems, browsers, games, and more. Please read the official documentation to learn more.

C++ by Example is a hands-on introduction to C++ using annotated example programs. Check out the first example or browse the full list below.

Examples

  1. Hello World - Your first C++ program
  2. Values - Basic types and values
  3. Variables - Declaring and using variables
  4. Constants - Working with constants
  5. For Loops - Iteration in C++
  6. If/Else - Conditional statements
  7. Switch - Multi-way branching
  8. Arrays - Fixed-size collections
  9. Vectors - Dynamic arrays
  10. Maps - Key-value pairs