aboutsummaryrefslogtreecommitdiff
path: root/cpp05/ex03
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-12-12 12:46:18 +0100
committerCharles Cabergs <me@cacharle.xyz>2020-12-12 12:46:59 +0100
commitd2d136a5810b8dc233b7a6260531e7fd0c138f3e (patch)
tree3a812a1aaeda50a6b6738a079997cdcd5a7b7ab2 /cpp05/ex03
parent0071b1e944cbce91ff6ff8e235280c3955ce1d5b (diff)
downloadpiscine_cpp-d2d136a5810b8dc233b7a6260531e7fd0c138f3e.tar.gz
piscine_cpp-d2d136a5810b8dc233b7a6260531e7fd0c138f3e.tar.bz2
piscine_cpp-d2d136a5810b8dc233b7a6260531e7fd0c138f3e.zip
Fixing compilation error on linux VM
Diffstat (limited to 'cpp05/ex03')
-rw-r--r--cpp05/ex03/RobotomyRequestForm.hpp3
-rw-r--r--cpp05/ex03/ShrubberyCreationForm.cpp7
-rw-r--r--cpp05/ex03/ShrubberyCreationForm.hpp3
3 files changed, 8 insertions, 5 deletions
diff --git a/cpp05/ex03/RobotomyRequestForm.hpp b/cpp05/ex03/RobotomyRequestForm.hpp
index f6cafd1..cd93100 100644
--- a/cpp05/ex03/RobotomyRequestForm.hpp
+++ b/cpp05/ex03/RobotomyRequestForm.hpp
@@ -6,13 +6,14 @@
/* By: cacharle <me@cacharle.xyz> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/10/19 13:43:37 by cacharle #+# #+# */
-/* Updated: 2020/12/12 12:20:48 by cacharle ### ########.fr */
+/* Updated: 2020/12/12 12:46:52 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef ROBOTOMYREQUESTFORM_HPP
# define ROBOTOMYREQUESTFORM_HPP
+# include <cstdlib>
# include "Form.hpp"
class RobotomyRequestForm : public Form
diff --git a/cpp05/ex03/ShrubberyCreationForm.cpp b/cpp05/ex03/ShrubberyCreationForm.cpp
index 262f166..3ad872c 100644
--- a/cpp05/ex03/ShrubberyCreationForm.cpp
+++ b/cpp05/ex03/ShrubberyCreationForm.cpp
@@ -6,7 +6,7 @@
/* By: cacharle <me@cacharle.xyz> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/10/19 13:45:45 by cacharle #+# #+# */
-/* Updated: 2020/11/17 17:15:43 by charles ### ########.fr */
+/* Updated: 2020/12/12 12:44:47 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -29,10 +29,11 @@ ShrubberyCreationForm::~ShrubberyCreationForm() {}
void ShrubberyCreationForm::executeUnsafe() const
{
- std::ofstream file(m_target + "_shrubbery");
+ std::string filename(m_target + "_shrubbery");
+ std::ofstream file(filename.c_str());
if (!file.is_open())
{
- std::cerr << "Error: " << m_target + "_shrubbery" << ": " << std::strerror(errno) << std::endl;
+ std::cerr << "Error: " << filename << ": " << std::strerror(errno) << std::endl;
return;
}
file <<
diff --git a/cpp05/ex03/ShrubberyCreationForm.hpp b/cpp05/ex03/ShrubberyCreationForm.hpp
index 27e34a0..b2c0b7d 100644
--- a/cpp05/ex03/ShrubberyCreationForm.hpp
+++ b/cpp05/ex03/ShrubberyCreationForm.hpp
@@ -6,13 +6,14 @@
/* By: cacharle <me@cacharle.xyz> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/10/19 13:43:27 by cacharle #+# #+# */
-/* Updated: 2020/12/12 12:20:33 by cacharle ### ########.fr */
+/* Updated: 2020/12/12 12:44:17 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef SHRUBBERYCREATIONFORM_HPP
# define SHRUBBERYCREATIONFORM_HPP
+# include <cerrno>
# include <string>
# include <cstring>
# include <fstream>