mn cop bài này về rồi chạy giúp mk với. mk k hiểu vì sao nó cứ báo rỗng
#include<iostream>
#include<string>
using namespace std;
struct Node{
int data;
struct Node *next;
}*start;
void Init(Node *p){
start=NULL;
}
Node *getnode(int x){
Node *p=new Node;
p->data=x;
p->next=NULL;
return p;
}
void input(Node *p,int x){
int n;
Node *temp,*s;
s=start;
cout<<"\n Nhap so node: "; cin>>n;
for(int i=1;i<=n;i++){
cout<<"Nhap gia tri: "; cin>>x;
temp=new Node;
temp->data=x;
temp->next= NULL;
}
}
void hienthi(Node *p){
Node *temp;
if(start==NULL){
cout<<"\n danh sach rong.";
}
temp=start;
cout<<"Danh sach: ";
while(start!=NULL ){
temp=start;
cout<<temp->data <<" -> ";
temp=temp->next;
}
cout<<" NULL"<<endl;
}
int main(){
Node *p;
int x;
Init(p);
input(p,x);
hienthi(p);
}

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?