内存申请
class Monster : public ATM
{
public:
Monster(int _rank) {rank=_rank,hp=rank*100,atk=rank*5,exp=rank*rank;}
Monster(){}
void beAtk(int a) {hp-=a;}
};
int main()
{
int t,time,k,n,i,flag;
cin >> time;
for(t=1; t <= time; t++)
{
cin >> k >> n;
ATM atm(k);
Monster **monster = new Monster*[n];
for(i=0; i<n; i++)
{
monster[i] = new Monster(2*i+1);
}
...}
return 0;
}
在主函数中Monster **monster = new Monster *[n]语句是什么意思?请大神解惑。