https://github.com/ricvrdv/cpp-01
C++ Module 01 - new, delete, references, file manipulation
https://github.com/ricvrdv/cpp-01
cplusplus cpp98 memory-management oops-in-cpp pointers-and-references
Last synced: 5 months ago
JSON representation
C++ Module 01 - new, delete, references, file manipulation
- Host: GitHub
- URL: https://github.com/ricvrdv/cpp-01
- Owner: ricvrdv
- Created: 2025-07-09T19:30:15.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-08-13T17:19:08.000Z (7 months ago)
- Last Synced: 2025-08-13T19:27:56.427Z (7 months ago)
- Topics: cplusplus, cpp98, memory-management, oops-in-cpp, pointers-and-references
- Language: C++
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# C++ Module 01
# Concepts:
- dynamic memory allocation: `new` and `delete`
- pointers to members
- references
- file manipulation
- `switch` statements
# ex00
Implemented a `Zombie` class with functions to create and announce zombies, exploring stack vs. heap allocation and object lifetime management.
Usage:
```
make
```
```
./zombie
```
# ex01
Created a `zombieHorde()` function that dynamically allocates and initializes multiple zombies in a single block, practicing memory management and cleanup.
Usage:
```
make
```
```
./horde
```
# ex02
Demonstrated the difference between pointers and references by printing both memory addresses and values of the same string in multiple ways.
Usage:
```
make
```
```
./brain
```
# ex03
Built `Weapon`, `HumanA`, and `HumanB` classes to explore the differences between holding objects by reference vs. by pointer and their effect on object behavior.
Usage:
```
make
```
```
./violence
```
# ex04
Developed a text-replacement program that reads a file, replaces all occurrences of a given string with another, and outputs to a `.replace` file without using `std::string::replace()`.
Usage:
```
make
```
```
./antiSed
```
# ex05
Automated a `Harl` class to print preset messages based on severity level using pointers to member functions instead of chained conditionals.
Usage:
```
make
```
```
./harl
```
# ex06
Extended `Harl` with a filter system to display only messages at or above a given severity level, using a `switch` statement for control flow.
Usage:
```
make
```
```
./harlFilter
```
----
✅ Check out [C++ Module 02](https://github.com/ricvrdv/cpp-02) - function and operator overloading
⏪️ Go back to [C++ Module 00](https://github.com/ricvrdv/cpp-00) - namespaces, classes, member functions, stdio streams, ...