冒号语法怎么用
class Student{
public:
Student(char*pName="no name",int ssID=0):id(ssID){} //为什么不能加{},如果id是常量或者引用为什么可以加{}
{
cout<<"Constructing student"<<pName<<endl;
strncpy(name,pName,sizeof(name));
name[sizeof(name)-1]='\0';
}
protected:
char name[20];
StudentID id;
};