An open API service indexing awesome lists of open source software.

https://github.com/hazeliscoding/pointer-notes

A cheatsheet to help anyone understand pointers in C++
https://github.com/hazeliscoding/pointer-notes

Last synced: 23 days ago
JSON representation

A cheatsheet to help anyone understand pointers in C++

Awesome Lists containing this project

README

          

# Pointer Cheat Sheet (C++)

A small C++ program that demonstrates:

* Passing by value
* Passing by reference
* Passing pointer addresses
* Stack scoping behavior
* Basic logging to console / debug window

Originally written to help beginners understand how data moves around in memory.

---

## 📦 Build & Run

### **Windows**

Requires **CMake** and **Visual Studio 2022** (or Build Tools).

```powershell
mkdir build
cd build
cmake ..
cmake --build .
./Debug/pointer_cheatsheet.exe
```

Or simply open the folder with Visual Studio and press **Ctrl + F5**.

### **Linux / Mac**

Requires **CMake** and a C++17 compiler (g++ or clang).

```bash
mkdir build
cd build
cmake ..
cmake --build .
./pointer_cheatsheet
```

---

## 📁 Project Structure

```
src/
Log.h
Log.cpp
main.cpp
CMakeLists.txt
```

---

## ✨ Notes

* On Windows, “debug window” logs use `OutputDebugString`.
Use Visual Studio or DebugView++ to see them.
* Console logs print normally everywhere.