Tsallaka zuwa abun ciki
Justice Tech School

C++ Introduction

C++ extends C with classes, templates and a large standard library. It is used for games, browsers, databases, trading systems and anything that needs speed and control. It is compiled, so you build a program with a compiler such as g++ and then run it.

Modern C++ (C++11 and newer) is much safer and shorter than old C++. These lessons use C++17.

Example
#include <iostream>

int main() {
  std::cout << "Hello, C++!" << std::endl;
  return 0;
}

Result

Hello, C++!
  • Fragments below are shown without the includes and main. The examples use "using namespace std;" so you can write cout instead of std::cout.

Exercise

Which object prints to the screen?

std:: << "Hi";

Quiz Test

What is C++ mainly known for?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.