注册 登录
编程论坛 新人交流区

[求助] 关于类传字符的问题

weiweizkk 发布于 2007-10-09 21:41, 424 次点击

#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为什么传不到类中,怎么做??? 如何修改??
类似这样的怎么传字符串????

1 回复
#2
Taste2007-10-11 15:48
帮你顶起来!~
1