From 8f162cde46a34d04e3a8a655067ee5174258e249 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 28 Mar 2026 16:20:14 +0200 Subject: feat(Week06): Add solutions --- Week06/Exercise01.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Week06/Exercise01.cpp (limited to 'Week06/Exercise01.cpp') diff --git a/Week06/Exercise01.cpp b/Week06/Exercise01.cpp new file mode 100644 index 0000000..ff6153f --- /dev/null +++ b/Week06/Exercise01.cpp @@ -0,0 +1,16 @@ +#include +#include + +int main() { + std::ofstream outFile("HelloWorld.txt", std::ios::trunc); + + if (!outFile.is_open()) { + std::cout << "Couldn't open file!" << std::endl; + } + else { + const char HELLO_WORLD[] = "Hello World!"; + outFile.write(HELLO_WORLD, sizeof(HELLO_WORLD) / sizeof(*HELLO_WORLD)); + } + + return 0; +} -- cgit v1.3.1-23-gd82d