diff --git a/cpp_1/main.cpp b/cpp_1/main.cpp index c7a337b..746af00 100644 --- a/cpp_1/main.cpp +++ b/cpp_1/main.cpp @@ -5,11 +5,11 @@ using namespace std; void readfile(string file); -void writefile(string file); +void writefile(string file, string text); int main() { - writefile("./testfile.txt"); + writefile("./testfile.txt","Hallo Welt!"); readfile("./testfile.txt"); return 0; } @@ -30,14 +30,14 @@ void readfile(string file) } } -void writefile(string file) +void writefile(string file, string text) { string line; ofstream myfile; myfile.open(file,std::ios_base::app); if (myfile.is_open()) { - myfile << "hallo\n"; + myfile << text+"\n"; } myfile.close(); } \ No newline at end of file diff --git a/cpp_1/program b/cpp_1/program index a8222c4..b6d2d9f 100755 Binary files a/cpp_1/program and b/cpp_1/program differ diff --git a/cpp_1/testfile.txt b/cpp_1/testfile.txt index 8aab54d..e69de29 100644 --- a/cpp_1/testfile.txt +++ b/cpp_1/testfile.txt @@ -1,4 +0,0 @@ -hallo -hallo -hallo -hallo