From 0f3240844dbd5a874e1565a988ef355ededab6a5 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 13 Apr 2020 10:33:05 +0200 Subject: Fixing cpp01 --- cpp01/ex05/Brain.hpp | 4 ++-- cpp01/ex05/Human.cpp | 11 ++++++++--- cpp01/ex05/Human.hpp | 13 +++++++------ 3 files changed, 17 insertions(+), 11 deletions(-) (limited to 'cpp01/ex05') diff --git a/cpp01/ex05/Brain.hpp b/cpp01/ex05/Brain.hpp index 6c1f28b..81b5a07 100644 --- a/cpp01/ex05/Brain.hpp +++ b/cpp01/ex05/Brain.hpp @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/02 12:47:22 by cacharle #+# #+# */ -/* Updated: 2020/02/02 16:28:27 by cacharle ### ########.fr */ +/* Updated: 2020/04/13 10:04:01 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,7 +19,7 @@ class Brain { - public: +public: std::string identify() const; }; diff --git a/cpp01/ex05/Human.cpp b/cpp01/ex05/Human.cpp index 4db0568..f4c0066 100644 --- a/cpp01/ex05/Human.cpp +++ b/cpp01/ex05/Human.cpp @@ -6,18 +6,23 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/02 12:52:38 by cacharle #+# #+# */ -/* Updated: 2020/02/02 13:08:39 by cacharle ### ########.fr */ +/* Updated: 2020/04/13 10:09:03 by charles ### ########.fr */ /* */ /* ************************************************************************** */ #include "Human.hpp" +Human::Human() + : m_brain() +{ +} + std::string Human::identify() { - return brain.identify(); + return m_brain.identify(); } const Brain& Human::getBrain() { - return brain; + return m_brain; } diff --git a/cpp01/ex05/Human.hpp b/cpp01/ex05/Human.hpp index 6c38ee0..d7a4611 100644 --- a/cpp01/ex05/Human.hpp +++ b/cpp01/ex05/Human.hpp @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/02 12:52:39 by cacharle #+# #+# */ -/* Updated: 2020/02/02 13:08:46 by cacharle ### ########.fr */ +/* Updated: 2020/04/13 10:08:07 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,12 +17,13 @@ class Human { - private: - const Brain brain; +public: + Human(); + std::string identify(); + const Brain& getBrain() ; - public: - std::string identify(); - const Brain& getBrain() ; +private: + const Brain m_brain; }; #endif -- cgit