怎么创建带参数构造函数类的对象数组
class Student
{
public:Student(int age, string name):m_age(age),m_name(name){}
private:const int m_age;
private:const string m_name;
}
申请内存是这样吗?
Student *p = new Student(12,"Xiaohong")[6];
class Student
{
public:Student(int age, string name):m_age(age),m_name(name){}
private:const int m_age;
private:const string m_name;
}
申请内存是这样吗?
Student *p = new Student(12,"Xiaohong")[6];
2015-07-19
举报