Website Summary Files Commits Branches @commit @diff @stats
path: root / Week06 / Exercise01.cpp
diff options
context:
space:
mode:
Commit8f162cde46a34d04e3a8a655067ee5174258e249 (patch)
Author
 Syndamia <kamen@syndamia.com>
2026-03-28 16:20:14 +0200
Committer
 Syndamia <kamen@syndamia.com>
2026-03-28 16:20:14 +0200
Filesbd99bfbbfd62759abee897216505def5a5e8dc31 /Week06/Exercise01.cpp
oop-2025-solutions-8f162cde46a34d04e3a8a655067ee5174258e249.tar
oop-2025-solutions-8f162cde46a34d04e3a8a655067ee5174258e249.tar.gz
oop-2025-solutions-8f162cde46a34d04e3a8a655067ee5174258e249.zip
Parent571dc57f812a685bda7bd3baf8aaf2ef56feae65 (diff)
feat(Week06): Add solutions
1 files changed, 16 insertions, 0 deletions
-rw-r--r--Week06/Exercise01.cpp16
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 <iostream>
+#include <fstream>
+
+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;
+}