We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c784037 commit f0cc663Copy full SHA for f0cc663
3 files changed
Makefile
@@ -1,3 +1,8 @@
1
CC=g++
2
all:
3
- $(CC) -Wall *.cpp
+ $(CC) -Wall *.cpp
4
+
5
+.PHONY: clean
6
7
+clean:
8
+ rm -f *.o*
main.cpp
@@ -1,10 +1,22 @@
#include <iostream>
+#include <fstream>
using std::cout;
+using std::fstream;
int main()
{
- cout << "C++ program";
9
+ const char* LOGFILE = "logs/data.txt";
10
+ fstream output;
11
+ output.open(LOGFILE, std::ios::out);
12
13
+ if( output.is_open() )
14
+ {
15
+ cout << LOGFILE << " opened.\n";
16
+ output << "Program has been run! in the container!\n";
17
+ output.close();
18
+ }
19
+ cout << "C++ program complete.\n";
20
21
return 0;
22
}
test_runner.sh
@@ -1,4 +1,4 @@
#!/bin/bash
-bash --version
-echo $?
+make clean && make
+./a.out
0 commit comments