|
#include<stdio.h>
#include<string.h>
#include<stdib.h>
#define LEN sizeof(struct AddressList)
struct AddressList
{
char name[20];
char telephone[12];
char e_mail[30];
struct AddressList *next;
};
atruct AddressList * create(void);
main()
{
struct AddressList *h;
h = create();
}
struct AddressList * create()
{
struct AddressList *head;
struct AddressList *p;
struct AddressList *tail;
char name[20];
head = NULL;
tail = NULL;
printf("Please input node data:\n");
printf("Name:");
gets(name);
while(strcmp(name,"")!=0)
{
p=(struct AddressList *)malloc(LEN);
if(p==NULL)
{
printf("Insufficient memory!\n");
exit(1);
}
else
{
strcpy(p-name,name);
printf("Phone:");
gets(p->telephone);
printf("Email address:");
gets(p->e_mail);
if(head==NULL)
head=p;
else
tail->next=p;
tail=p;
printf("\n please enter the next node data:\n");
printf("Name:");
gets(name);
}
}
if (head !=NULL)
tail->next=NULL;
printf("The process of establishing a linked list ends\n");
return head;
}
--------------------Configuration: 2 questions-Win32 Debug--------------------
Compiling...
2 questions.cpp
F:\2题.cpp(3): fatal error C1083: Cannot open include file:'stdib.h': No such file or directory
An error occurred while executing cl.exe.
2 questions.obj-1 error(s), 0 warning(s) |
|