[求助] 关于类传字符的问题
#include<iostream.h>
class Student
{
public:
Student(char a,int b,float c)
{
h=a;
w=c;
q=b;
fen+=w;
}
friend void ping();
private:
char h;
float w;
int q;
static float fen;
};
float Student::fen=0;
void ping()
{
cout<<Student::fen/Student.q<<endl;
}
void main()
{
Student s1(z,1,90.5);
ping();
}
Student s1(z,1,90.5)这句话的z为什么传不到类中,怎么做??? 如何修改??
类似这样的怎么传字符串????