aboutsummaryrefslogtreecommitdiff
path: root/cpp05/ex00/main.cpp
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-11-17 13:52:48 +0100
committerCharles Cabergs <me@cacharle.xyz>2020-11-17 13:52:48 +0100
commit331c3596660fed6c8b04fdfd0a89435ccffaaf20 (patch)
tree4196c94d9084a3d0ed45f3ec798d713639cbfc8a /cpp05/ex00/main.cpp
parent4eecb32ffcf48c42672782fbcd53781a22e95ebf (diff)
downloadpiscine_cpp-331c3596660fed6c8b04fdfd0a89435ccffaaf20.tar.gz
piscine_cpp-331c3596660fed6c8b04fdfd0a89435ccffaaf20.tar.bz2
piscine_cpp-331c3596660fed6c8b04fdfd0a89435ccffaaf20.zip
Fixing cpp05/ex00-02
Diffstat (limited to 'cpp05/ex00/main.cpp')
-rw-r--r--cpp05/ex00/main.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/cpp05/ex00/main.cpp b/cpp05/ex00/main.cpp
index ebfed5a..90092cf 100644
--- a/cpp05/ex00/main.cpp
+++ b/cpp05/ex00/main.cpp
@@ -6,7 +6,7 @@
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/14 18:13:05 by charles #+# #+# */
-/* Updated: 2020/04/14 18:43:15 by charles ### ########.fr */
+/* Updated: 2020/11/17 11:51:33 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,9 +14,24 @@
int main()
{
- Bureaucrat a("jean", 140);
- Bureaucrat b("didier", 10);
+ std::cout << "############### CREATION" << std::endl;
+ try { Bureaucrat bu("YO", 0); }
+ catch (std::exception& e) { std::cout << e.what() << std::endl; }
+ try { Bureaucrat bu("YO2", 151); }
+ catch (std::exception& e) { std::cout << e.what() << std::endl; }
+
+ Bureaucrat yep("YEP", 1);
+ Bureaucrat yep2(yep);
+ Bureaucrat yep3("SHOULD NOT BE PRINTED", 42);
+ yep3 = yep;
+ std::cout << yep;
+ std::cout << yep2;
+ std::cout << yep3;
+
+ std::cout << std::endl;
+ std::cout << "############### DECREMENT" << std::endl;
+ Bureaucrat a("jean", 140);
while (true)
{
try
@@ -31,6 +46,9 @@ int main()
}
}
+ std::cout << std::endl;
+ std::cout << "############### INCREMENT" << std::endl;
+ Bureaucrat b("didier", 10);
while (true)
{
try
@@ -44,5 +62,6 @@ int main()
break;
}
}
+
return 0;
}