eas_m66
سه شنبه 22 خرداد 1386, 21:57 عصر
سلام من یک کلاس اعضا دارم که کد اون به صورت زیر :
کد:
class member
{
public:
char name[20];
char family[25];
char name-f[20];
int phone;
float number-n;
}
//*******************
class student:public member
{
char spun-e[30];
char section[20];
public:
void enter();
void print(int &);
}
//******************
void student::enter()
{
clrscr();
cout<<"number-n "<<"name "<<"family "
<<"name-f "<<"spun-e "<<"section"<<"phone"<<endl;
cout<<"\n __________________________________________________ _________________";
cin>>number-n;
gotoxy(22,2);
cin>>name;
gotoxy(25,2);
cin>>family;
gotoxy(32,2);
cin>>name-f;
gotoxy(40,2);
cin>>spun-e;
gotoxy(46,2);
cin>>section;
gotoy(54,2);
cin>>phone;
}
//*******************
void stuent::print(int& row)
{
gotoxy(1,row);
cout<<number-n;
gotoxy(22,row);
cout<<name;
gotoxy(25,row);
cout<<family;
gotoxy(32,row);
cout<<name-f;
gotoxy(40,row);
cout<<spun-e;
gotoxy(46,row);
cout<<section;
gotoxy(54,row);
cout<<phone;
}
من چندتا مشکل دارم:یکی اینکه نمی دوم چرا در تابع enter کلاس مشتقerror می ده .بعد باید براش یک فایل بذارم ولی هر کار می کنم نمی تونم دقیق بنویسم اگه می شه کمک کنید.ممنونم:متفکر:
کد:
class member
{
public:
char name[20];
char family[25];
char name-f[20];
int phone;
float number-n;
}
//*******************
class student:public member
{
char spun-e[30];
char section[20];
public:
void enter();
void print(int &);
}
//******************
void student::enter()
{
clrscr();
cout<<"number-n "<<"name "<<"family "
<<"name-f "<<"spun-e "<<"section"<<"phone"<<endl;
cout<<"\n __________________________________________________ _________________";
cin>>number-n;
gotoxy(22,2);
cin>>name;
gotoxy(25,2);
cin>>family;
gotoxy(32,2);
cin>>name-f;
gotoxy(40,2);
cin>>spun-e;
gotoxy(46,2);
cin>>section;
gotoy(54,2);
cin>>phone;
}
//*******************
void stuent::print(int& row)
{
gotoxy(1,row);
cout<<number-n;
gotoxy(22,row);
cout<<name;
gotoxy(25,row);
cout<<family;
gotoxy(32,row);
cout<<name-f;
gotoxy(40,row);
cout<<spun-e;
gotoxy(46,row);
cout<<section;
gotoxy(54,row);
cout<<phone;
}
من چندتا مشکل دارم:یکی اینکه نمی دوم چرا در تابع enter کلاس مشتقerror می ده .بعد باید براش یک فایل بذارم ولی هر کار می کنم نمی تونم دقیق بنویسم اگه می شه کمک کنید.ممنونم:متفکر: