65,186
社区成员




Student(const char * str, const double * pd,int n):name(str),scores(pd,n){} //这是构造函数
//初始化
valarray<double>a(90,19); //正常运行
Student no1("tom",90,19); //出错
const double* pd = 90; // 报错
你可以先声明一个变量,然后取址就可以了:
double a = 90;
Student no1("tom",&a,19);