Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง  Pointer Playground (C++)

A hands-on C++ project focused on understanding pointers, dynamic memory allocation, heap memory, and multi-file project architecture.

This project was built as part of a structured C++ learning journey to make pointers practical before moving into Data Structures & Algorithms.

Instead of memorizing syntax, the goal was to understand how memory works behind the scenes using dynamic arrays, dynamic matrices, and dynamic string buffers.


๐Ÿš€ Features

๐Ÿ“ฆ Dynamic Array Module

  • Create arrays at runtime
  • Store user-defined values
  • Display stored elements
  • Proper memory cleanup

๐Ÿงฎ Dynamic Matrix Module

  • Create 2D matrices dynamically
  • Input and display matrix values
  • Nested dynamic memory allocation
  • Safe memory deallocation

๐Ÿ“ Dynamic String Buffer Module

  • Create dynamic character buffers
  • Store user text
  • Display stored text
  • Release allocated memory

๐ŸŽฎ Menu Driven Interface

  • Interactive console menu
  • Easy navigation between modules
  • Safe program termination

๐Ÿง  Concepts Practiced

Pointer Fundamentals

  • Pointer Declaration
  • Address Operator (&)
  • Dereference Operator (*)
  • Null Pointers (nullptr)

Dynamic Memory Management

  • new
  • delete
  • new[]
  • delete[]

Memory Concepts

  • Stack Memory
  • Heap Memory
  • Memory Allocation
  • Memory Deallocation
  • Memory Leak Prevention

Multi-Level Pointers

  • int*
  • int**
  • char*

C++ Fundamentals Reinforced

  • Functions
  • Arrays
  • Loops
  • User Input
  • Modular Programming
  • Header Files
  • Source Files

๐Ÿ“‚ Project Structure

pointer-playground-cpp/
โ”‚
โ”œโ”€โ”€ include/
โ”‚   โ”œโ”€โ”€ dynamic_array.h
โ”‚   โ”œโ”€โ”€ dynamic_matrix.h
โ”‚   โ”œโ”€โ”€ string_buffer.h
โ”‚   โ””โ”€โ”€ menu.h
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ dynamic_array.cpp
โ”‚   โ”œโ”€โ”€ dynamic_matrix.cpp
โ”‚   โ”œโ”€โ”€ string_buffer.cpp
โ”‚   โ”œโ”€โ”€ menu.cpp
โ”‚   โ””โ”€โ”€ main.cpp
โ”‚
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ LICENSE
โ””โ”€โ”€ .gitignore

โš™๏ธ Compilation

g++ src/main.cpp src/menu.cpp src/dynamic_array.cpp src/dynamic_matrix.cpp src/string_buffer.cpp -Iinclude -Wall -Wextra -pedantic -std=c++17 -o app

โ–ถ๏ธ Run

./app

๐Ÿ“ธ Sample Output

==================================
       POINTER PLAYGROUND
==================================

1. Dynamic Array
2. Dynamic Matrix
3. Dynamic String Buffer
4. Exit

Enter choice:

๐ŸŽฏ Learning Outcomes

After completing this project, I gained practical experience with:

  • Dynamic Arrays
  • Dynamic Matrices
  • Dynamic String Buffers
  • Heap Memory Management
  • Pointer Operations
  • Double Pointers
  • Runtime Memory Allocation
  • Memory Cleanup Techniques
  • Multi-File Project Architecture

This project serves as a bridge between beginner C++ programming and advanced Data Structures & Algorithms concepts such as:

  • Linked Lists
  • Trees
  • Graphs
  • Tries
  • Dynamic Data Structures

๐Ÿ’ก Why This Project Matters

Pointers are one of the most important concepts in C++ and often the biggest obstacle for beginners.

This project focuses on understanding:

  • Where data lives in memory
  • How heap allocation works
  • How pointers access data
  • How memory leaks happen
  • How dynamic data structures are built internally

By building everything manually, the underlying mechanics become much easier to understand before diving into DSA.


๐Ÿ› ๏ธ Technologies Used

  • C++17
  • GCC / G++
  • Linux
  • Git & GitHub

๐Ÿ“ˆ Project Progression

This project was built after completing:

  1. Number Guessing Game
  2. Calculator
  3. Banking Management System
  4. Library Management System

Pointer Playground marks the transition from basic programming concepts to memory-oriented programming and DSA preparation.


๐Ÿ‘จโ€๐Ÿ’ป Author

Mehfooz

GitHub: https://github.com/whoismehfooz


๐Ÿ“œ License

This project is licensed under the MIT License.

Feel free to learn from, modify, and improve this project.

About

๐Ÿ‘‰ A C++ project focused on pointers, dynamic memory allocation, heap management, and multi-file architecture.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages