From 16e6fba2d0b8921effd8cdc6a7ef06b7a885a715 Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 12 Nov 2022 13:12:51 +0100 Subject: [PATCH] Add a bit more C++ stuff to the C++ app --- apps/src/hello-cpp.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/src/hello-cpp.cpp b/apps/src/hello-cpp.cpp index 15a1fcaa..a6eda67f 100644 --- a/apps/src/hello-cpp.cpp +++ b/apps/src/hello-cpp.cpp @@ -1,6 +1,19 @@ #include +#include +#include int main() { - printf("Well hello world!\n"); + std::printf("Well hello world!\n"); + + std::string str = "this is a c++ string"; + + str.append(" yay"); + + std::printf("%s\n", str.c_str()); + + std::vector vec = {3, 2, 8}; + + for (int i : vec) { std::printf("%d ", i); } + std::putchar('\n'); } \ No newline at end of file