64,651
社区成员
发帖
与我相关
我的任务
分享
const int INIT_CAPACITY = 1000000;
class Demo {
public:
Demo(); // constructor
string at(int i);
private:
string *bigArray;
};
Demo::Demo()
{
bigArray = new string[INIT_CAPACITY];
for (int i=0;i<INIT_CAPACITY;i++) {
bigArray[i] = "Lalalalalalalalala! ";
}
}
string Demo::at(int i)
{
return bigArray[i];
}