类内初始化成员问题
#include<iostream>using namespace std;
class Student{
private:
string s[3];
public:
Student()
{
cout<<"use one"<<endl;
}
Student(string a,string b,string c)
{
s[0] = a;
s[1] = b;
s[2] = c;
cout<<"use two"<<endl;
}
};
int main()
{
Student s1("123","1234","12345");
Student s2();
return 0;
}
帮忙看一下,为什么会跳过对象s2直接结束。