Free course · Lesson 1 of 5
C++ Fundamentals & Setup
In this lesson you will
- Build and run a C++ program
- Store values in typed variables and print them
C++ gives you direct control over how a program uses memory and hardware, which is why it powers game engines, embedded devices, and performance-critical systems. It is a compiled language: your source code is translated into a native executable before it ever runs.
- Every program needs a
main()function — execution starts there. - Core types:
int,double,char,bool,std::string. std::coutprints output;std::cinreads input, both from<iostream>.- Every statement ends with a semicolon; a program is built by a compiler (
g++or Clang) before it runs.
💡 Practical Skill: Install a modern compiler (g++ via MinGW or a Linux/WSL environment) and VS Code with the C/C++ extension. Get comfortable reading compiler errors — in C++ they're detailed and worth reading carefully.
#include <iostream>#include <string> int main() { std::string name = "Grace"; int age = 22; std::string city = "Juba"; std::cout << name << " is " << age << " years old and lives in " << city << "." << std::endl; return 0;}
Practice exercise
Write a program that stores the price and quantity of an item in SSP, then prints the total cost with a label.
Key takeaways
- C++ is compiled into an executable before it runs
- Every variable has a type and should be initialised
- Build with warnings on and fix every warning
Free self-study lesson — no certificate. For the full instructor-led program, see registration options.