# C++ Fundamentals

This guide aims to provide you with the fundamentals of C++. It's **not** meant to be an exhaustive guide. For more in-depth details, you should refer to the [official C++ reference](https://en.cppreference.com/w/).

We do assume that you have basic programming knowledge and are cognizant of common programming constructs (i.e variables, functions, loops).

### Getting started

To run C++ code, you will need a **compiler**. Alternatively, you can also use an online compiler like [JDoodle](https://www.jdoodle.com/online-compiler-c++17) to follow along.

#### Mac

To check if you have the `clang++` compiler installed, run:

```bash
clang++ --version
```

If not, you can install it via:

```bash
xcode-select --install
```

A software update window will pop up. You will need to agree to the licensing agreement before you can commence installing.

If all goes well, you should be greeted with:

<figure><img src="https://2807223923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUqAJOgHs57S8lmqdxRV%2Fuploads%2FTKfxxttYshsigPRpVeZW%2FScreenshot%202026-04-01%20at%201.36.05%E2%80%AFAM.png?alt=media&#x26;token=3c2fffc6-2d05-41ed-b408-e2f882630feb" alt=""><figcaption></figcaption></figure>

#### Windows

On Windows, the setup process varies. The simplest option is to install an Integrated Development Environment (IDE) like [Dev-C++](https://www.dev-cpp.com/) that bundles with a C++ compiler.

#### Ubuntu / Debian

To check if you have the `g++` compiler installed, you can check via:

```bash
g++ --version
```

If it is not installed, you can install it via your favourite package manager.

```bash
sudo apt update
sudo apt update g++
```
