#include <iostream>
#include <sstream>
#include <string>
using namespace std;
class Quota{
public:
string quotaName;
int paramter;
Quota(){}
Quota(string quotaName,int paramter){
this->quotaName=quotaName;
this->paramter=paramter;
}
};
int main(){
Quota **quota;
quota=new Quota*[10];
for (int i=0;i<10;i++)
{
quota[i]=new Quota[20];
for (int j=0;j<20;j++)
{
quota[i][j]=Quota();
quota[i][j].paramter=j;
stringstream ss;
ss<<i;
string str=ss.str();
quota[i][j].quotaName="参数"+str;
}
}
for (int i=0;i<10;i++)
{
for (int j=0;j<20;j++)
{
cout<<"参数名: "<<quota[i][j].quotaName<<" 参数值:"<<quota[i][j].paramter<<endl;
}
}
for (int i=0;i<10;i++)
{
delete []quota[i];
quota[i]=NULL;
}
delete []quota;
quota=NULL;
}
#include <sstream>
#include <string>
using namespace std;
class Quota{
public:
string quotaName;
int paramter;
Quota(){}
Quota(string quotaName,int paramter){
this->quotaName=quotaName;
this->paramter=paramter;
}
};
int main(){
Quota **quota;
quota=new Quota*[10];
for (int i=0;i<10;i++)
{
quota[i]=new Quota[20];
for (int j=0;j<20;j++)
{
quota[i][j]=Quota();
quota[i][j].paramter=j;
stringstream ss;
ss<<i;
string str=ss.str();
quota[i][j].quotaName="参数"+str;
}
}
for (int i=0;i<10;i++)
{
for (int j=0;j<20;j++)
{
cout<<"参数名: "<<quota[i][j].quotaName<<" 参数值:"<<quota[i][j].paramter<<endl;
}
}
for (int i=0;i<10;i++)
{
delete []quota[i];
quota[i]=NULL;
}
delete []quota;
quota=NULL;
}