{"id":22438919,"url":"https://github.com/cypri1-dev/42_cpp01","last_synced_at":"2025-03-27T09:23:56.089Z","repository":{"id":257860638,"uuid":"870660658","full_name":"cypri1-dev/42_CPP01","owner":"cypri1-dev","description":"This project, C++ Module 01, focuses on dynamic memory allocation, pointers, and object relationships. You will implement a Zombie class, create a horde of zombies, manage strings, and develop a complaint system using function pointers and switch statements. These exercises provide a solid foundation in C++ programming concepts and practices.","archived":false,"fork":false,"pushed_at":"2024-10-17T11:14:55.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T14:18:15.381Z","etag":null,"topics":["42","42projects","cpp","cpp01"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cypri1-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-10T12:48:28.000Z","updated_at":"2024-10-29T13:06:57.000Z","dependencies_parsed_at":"2024-10-16T19:25:07.117Z","dependency_job_id":"36d73f89-9e0a-40b4-983e-242b04fa8076","html_url":"https://github.com/cypri1-dev/42_CPP01","commit_stats":null,"previous_names":["cypri1-dev/42_cpp01"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cypri1-dev%2F42_CPP01","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cypri1-dev%2F42_CPP01/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cypri1-dev%2F42_CPP01/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cypri1-dev%2F42_CPP01/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cypri1-dev","download_url":"https://codeload.github.com/cypri1-dev/42_CPP01/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245815371,"owners_count":20676912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["42","42projects","cpp","cpp01"],"created_at":"2024-12-06T01:12:10.270Z","updated_at":"2025-03-27T09:23:56.066Z","avatar_url":"https://github.com/cypri1-dev.png","language":"C++","readme":"## \n\u003ch1\u003e\u003cimg src=\"https://raw.githubusercontent.com/ayogun/42-project-badges/refs/heads/main/covers/cover-cpp-bonus.png\"\u003c/h1\u003e\n\n## Description\nThis project, C++ Module 01, focuses on dynamic memory allocation, pointers, and object relationships. You will implement a Zombie class, create a horde of zombies, manage strings, and develop a complaint system using function pointers and switch statements. These exercises provide a solid foundation in C++ programming concepts and practices.\n\n## Exercise 00 - BraiiiiiiinnnzzzZ\nObjectives 🚀:\n- This exercise will introduce you to dynamic memory allocation and pointer manipulation in C++.\n- You will be creating a class that represents a zombie.\nRequirement:\n- Create a ```Zombie``` class. Each zombie will have a name.\n- Implement a member function named ```announce()``` that will print the following message: ```\u003cname\u003e: BraiiiiiiinnnzzzZ...```.\n- The name of the zombie should be passed to the constructor.\n- Create a function named ```newZombie()``` which takes a string representing a name and returns a pointer to a new zombie.\n- Create a function named ```randomChump()``` that creates a zombie, assigns it a random name, and immediately announces it.\n- Your main function should create several zombies (both on the stack and on the heap) and have them announce themselves.\n\n## Exercise 01 - Even More Brains!\nObjectives 🚀:\n- This exercise builds on the previous one by exploring the behavior of destructors.\n- You will create and destroy zombies dynamically.\nRequirements:\n- Add a destructor to your ```Zombie``` class that prints the message: ```\u003cname\u003e is destroyed```.\n- In your main function, dynamically allocate several zombies, have them announce themselves, and then properly destroy them to ensure there are no memory leaks.\n\n## Exercise 03 - Useless Violence\nObjectives 🚀:\n- This exercise introduces the ```Weapon``` class and explores how objects can be passed around by reference.\nRequirements:\n- Create a ```Weapon``` class that has a ```type``` attribute and a ```getType()``` method that returns the type.\n- Create a ```setType()``` method that modifies the weapon type.\n- Create a ```HumanA``` class that takes a reference to a ```Weapon``` in its constructor and has an ```attack()``` method that prints a message containing the human's name and the weapon type.\n- Create a ```HumanB``` class that is similar to ```HumanA``` but allows the weapon to be set later on using a method.\n\n## Exercise 04 - Sed Is for Losers\nObjectives 🚀:\n- This exercise introduces basic file input/output (I/O) and string manipulation in C++.\nRequirements:\n- Write a program that takes a filename and two strings as parameters.\n- The program should open the file, replace all occurrences of the first string with the second string, and write the results to a new file.\n\n## Exercise 05 - Harl 2.0\nObjectives 🚀:\n- This exercise explores the ```switch``` statement and organizing code with different levels of verbosity.\nRequirements:\n- Create a ```Harl``` class with four member functions: ```debug()```, ```info()```, ```warning()```, and ```error()```.\n- Implement a ```complain()``` function that calls one of the four methods based on the input string passed to it.\n- Use a ```switch``` statement to choose which method to call.\n\n## Exercise 06 - Harl Filter\nObjectives 🚀:\n- This exercise builds on the previous one by introducing filters.\nRequirements:\n- Modify the ```Harl``` class to print only messages at or above a certain severity level. The severity levels are ```debug```, ```info```, ```warning```, and ```error```.\n- Implement this filtering logic so that Harl only complains at the specified level or higher.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcypri1-dev%2F42_cpp01","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcypri1-dev%2F42_cpp01","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcypri1-dev%2F42_cpp01/lists"}