When I run this hello world function:
#include <iostream>
/*
welcome to your first c++ tutorial! Congrats lets have some fun :)
*/
int main() {
std::cout << "hello world\n";
int e{ 2 };
std::cout << e;
return 0;
}
I get this error:
[Running] cd "/Users/tbarton/Documents/GitHub/c++ practice files/" && g++ main.cpp -o main && "/Users/tbarton/Documents/GitHub/c++ practice files/"main
main.cpp:9:10: error: expected ';' at end of declaration
int e{ 2 };
^
;
1 error generated.
[Done] exited with code=1 in 0.388 seconds
I'm a super noob for c++ so I'm lost. Any idea what it is?