Skip to content

Commit a9e3fe0

Browse files
author
Nuno Miguel Nuno Carvalho
committed
[CPP05] Done
1 parent adf3891 commit a9e3fe0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lvl_4_cpp_modules/CPP05/ex03/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@ int main(int argc, char **argv)
2020
AForm *b;
2121
AForm *c;
2222

23+
cout << endl;
24+
2325
Intern Arnaldo;
2426

2527
a = Arnaldo.makeForm("robotomy request", "Ebil");
28+
cout << endl;
2629
b = Arnaldo.makeForm("presidential pardon", "Ebil");
30+
cout << endl;
2731
c = Arnaldo.makeForm("shrubbery creation", "Ebil");
32+
cout << endl;
2833

2934
Arnaldo.makeForm("foo", "Ebil");
35+
cout << endl;
3036

3137
delete a;
3238
delete b;

lvl_4_cpp_modules/CPP05/ex03/srcs/Intern.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ AForm *Intern::makeForm(std::string name, std::string target)
5454
else
5555
delete forms[i];
5656
}
57-
cout << "Intern couldn't create " << name << " form" << endl;
57+
if (choosen_form == NULL)
58+
cout << "Intern couldn't create " << name << " form" << endl;
5859
return choosen_form;
5960
}

0 commit comments

Comments
 (0)