#include<iostream>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
struct dslk
{
int data;
dslk *link;
};
//struct dslk *head;
void taorong (dslk *head)
{
head=NULL;
}
void chendau (dslk *head, int x)
{
dslk *p=new dslk;
p->link=head;
head=p;
p->data=x;
}
void nhap (dslk *head)
{
int n,x;
cout<<"ban can nhap bao nhieu phan tu ";cin>>n;
for(int i=1;i<=n;i++)
{
cout<<"nhap phan tu thu "<<i<<": ";cin>>x;
chendau(head,x);
}
}
void xuat (dslk *head)
{ dslk *p=head;
while(p!=NULL)
{
cout<<p->data;
p=p->link;}
}
int main ()
{
dslk *head;
taorong(head);
nhap(head);
xuat(head);
}
Trong Dev C++ link list chạy được nhưng chỉ nhập được mà xuất không được! tại code hay là tại dev c++ nó không hiểu
mong mọi người giúp giùm mình với