1
0
Files
CPP_Module_05/ex02/main.cpp
2025-04-09 16:20:55 +02:00

57 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/09 16:20:39 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 &) {
}
ShrubberyCreationForm s;
try {
knl.signForm(s);
} catch (std::exception &e) {
knl.executeForm(s);
std::cerr << "Error : " << e.what() << std::endl;
}
std::cout << knl << std::endl;
}