[英]Error while declaring int variable using curly braces in g++
I compiled this code using g++ and got an error: 我使用g ++编译了此代码,但出现错误:
#include<iostream>
using namespace std;
int main()
{
int j{ 0 };
cout << "j = " << j << endl;
return 0;
}
This is the error: 这是错误:
error: expected ';' at end of declaration
int j{ 0 };
^
;
1 error generated.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.