> For the complete documentation index, see [llms.txt](https://learncpp.benntan.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learncpp.benntan.com/cpp-fundamentals.md).

# 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.&#x20;

#### 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="/files/XI53OU4b2vhrHn9CQa32" 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.&#x20;

#### 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++
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learncpp.benntan.com/cpp-fundamentals.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
