Skip to content

Latest commit

 

History

History
55 lines (32 loc) · 1.38 KB

README.md

File metadata and controls

55 lines (32 loc) · 1.38 KB

Screenshot from 2025-01-16 16-42-47

CPP Module 01

This module explores fundamental C++ concepts including memory allocation, pointers, references, and file operations.

Exercises Overview

ex00: BraiiiiiiinnnzzzZ

Implementation of a Zombie class with different memory allocation approaches:

  • Stack allocation (automatic memory management)
  • Heap allocation (manual memory management)

ex01: Moar brainz!

Creating and managing multiple zombies using array allocation.

ex02: HI THIS IS BRAIN

Demonstration of pointers and references in C++, showing different ways to access memory.

ex03: Unnecessary violence

Implementation of weapon system with two human classes demonstrating different approaches to weapon handling.

ex04: Sed is for losers

File manipulation program that replaces occurrences of strings in a file.

ex05: Harl 2.0

Implementation of a complaint system using member function pointers.

Memory Management Tools

To check for memory leaks, use:

valgrind --leak-check=full ./your_program

Or use Address Sanitizer during compilation:

g++ -fsanitize=address -g your_files.cpp -o your_program

Important Concepts

  • Stack vs Heap allocation
  • Proper memory management (new/delete pairing)
  • File operations in C++
  • Pointers to member functions