我在创建新的 ipython 笔记本时遇到问题。以前我曾经这样做到 new -> python 但现在我看不到任何 python 选项。另外,我无法打开任何 ipython 笔记本,我已经上传了几个小时了。
#include<iostream>
#include<stdio.h>
using namespace std;
class Test
{
private:
int array[]={0,2,4,6,8,10,12};//this line is the root cause of the error but why ?
public :
void compute();
};
void Test::compute()
{
int result =0;
for(int i=0;i<7;i++)
{
result += array[i];
}
cout<<result;
}
int main()
{
Test obj;
obj.compute();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
如果我将int array[]上面的代码替换为,array[7]则程序将编译并运行并显示警告。