I am receiving the following error:
error: expected ';' at end of declaration
int hello {8};
^
;
1 error generated.
I just bought this computer and downloaded VS Code. I ran xcode-select --install
in the terminal. I have the XCode developer tools. I can run the C++ program, but not with this form of variable initialization.
#include <iostream>
int main() {
int hello {8};
std::cout << "hello world" << std::endl;
return 0;
}
Other things I tried:
- Uninstalled xcode and installed, did not work
- Enabled c++20 cppstandard in vscode, did not work
- Uninstalled vscode and installed, did not work