1
0
Files
CPP_Module_05/ex02/main.cpp
2025-04-03 16:07:05 +02:00

58 lines
1.5 KiB
C++

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/23 14:01:11 by adjoly #+# #+# */
/* Updated: 2025/04/03 15:49:50 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "Bureaucrat.hpp"
#include "AForm.hpp"
#include "ShrubberyCreationForm.hpp"
#include <iostream>
int main(void) {
Bureaucrat knl("Kanel", 10);
knl--;
std::cout << knl << std::endl;
knl++;
std::cout << knl << std::endl;
try {
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
knl++;
} catch (const std::exception &e) {
std::cerr << "Error : " << e.what() << std::endl;
}
ShrubberyCreationForm s;
try {
s.beSigned(knl);
} catch (std::exception &e) {
knl.executeForm(s);
std::cerr << "Error : " << e.what() << std::endl;
}
std::cout << knl << std::endl;
}