This commit is contained in:
Camille Chauvet
2023-05-22 12:04:39 +00:00
parent 49f93acdee
commit 11eb368caf
8 changed files with 291 additions and 0 deletions

17
ex01/include/Contact.hpp Normal file
View File

@ -0,0 +1,17 @@
#include <string>
#include <iostream>
class Contact {
private:
std::string first_name;
std::string last_name;
std::string nickname;
std::string phone_number;
std::string darkest_secret;
public:
Contact(std::string first_name, std::string last_name, std::string nickname, std::string phone_number, std::string darkest_secret);
std::string to_string_partial() const;
std::string to_string_complete() const;
};

View File

@ -0,0 +1,17 @@
#include "Contact.hpp"
#include <cstddef>
class PhoneBook {
private:
Contact *contacts[8];
public:
size_t len;
PhoneBook();
~PhoneBook();
void add_contact(Contact *new_contact);
void display_contacts();
Contact* search(int index);
};

3
ex01/include/utils.hpp Normal file
View File

@ -0,0 +1,3 @@
#include <string>
std::string truncated(const std::string str);