#include <iostream>
#include <string>
#include <fstream>
using namespace std;
class stu{
string name;
string clas;
int phone;
double point;
public : stu(){
cout <<"Name: ";
getline(cin, name);
cout << endl;
cout <<"Class: ";
cin >> clas;
cout << endl;
cout <<"Mobile phone: ";
cin >> phone;
cout << endl;
cout <<"Grade point average: ";
cin >> point;
cout << endl;
};
stu *next;
stu *prev;
};
class list{
int n;
stu *first;
stu *last;
public: list();
void inithand(){
cout <<"How many students do you wnat to add: ";
cin >> n;
cin.ignore();
stu *hs = new stu();
list.first = hs;
for ( int i = 2; i <= n; ++i){
hs->next = new stu();
}
}
void initauto();
void printfull();
void printnp();
void find();
void insert();
void dclas();
void sort();
void insertnew();
void save();
};
int main(){
system("pause");
return 0;
}
Khi debut thì có lỗi error C2143: syntax error : missing ';' before '.' ở dòng list.first = hs;. Mọi người có thể giải thích giúp em tại sao không ạ?
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?