我使用 g++ 编译了这段代码并得到了一个错误:
#include<iostream>
using namespace std;
int main()
{
int j{ 0 };
cout << "j = " << j << endl;
return 0;
}
这是错误:
error: expected ';' at end of declaration
int j{ 0 };
^
;
1 error generated.
最佳答案
关于c++ - 在 g++ 中使用花括号声明 int 变量时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51147355/