Mình đang dùng VC 08
hôm qua làm bài này nhưng nó cứ báo lỗi là không tìm thấy thư viện alloc.h và string.h .Các bác giúp em sửa lỗi này với
Code:
#include "stdafx.h"
#include<alloc.h>
#include<conio.h>
#include<tring.h>
typedef struct pp
{
char ht[25];
char qq[20];
int tuoi;
struct pp *tiep;
}person;
main()
{
int t;
char ht[25],qq[20];
person *pdau,*p,*p1;
clsrscr();
pdau=NuLL;
while(1)
{
printf("ho ten \n");
get(ht);
if(ht[0]==0)
break;
if(pdau==NuLL)
{
pdau==(person*)malloc(sizeof(person));
p=pdau;
}
else
{
p->tiep=(peson*)malloc(sizeof(person));
p=p_>tiep;
}
strcpy(p->ht,ht);
printf(" \n que quan ");
gets(p->qq);
printf("\n tuoi ");
scanf("%d%*c",&t);
p->tuoi=t;
p->tiep=NuLL;
}
P=pdau;
while(p!=NuLL)
{
printf("\n ho ten %-25s que %-30s tuoi %d",(*p).ht,(*p).qq,(*p).tuoi);
p=p->tiep;
}
getch();
}
Yêu cầu để code vào tag code (ký hiệu
hoặc
trên thanh công cụ). Posted by iamvtn