Add a bit more C++ stuff to the C++ app
This commit is contained in:
parent
de2451e553
commit
16e6fba2d0
@ -1,6 +1,19 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
int main()
|
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<int> vec = {3, 2, 8};
|
||||||
|
|
||||||
|
for (int i : vec) { std::printf("%d ", i); }
|
||||||
|
std::putchar('\n');
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user