| |

VerySource

 Forgot password?
 Register
Search
View: 811|Reply: 5

Problems occurred when running the program in VC++6.0

[Copy link]

2

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-11-4 12:30:01
| Show all posts |Read mode
#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)
Reply

Use magic Report

0

Threads

20

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 China

Post time: 2020-11-4 13:45:01
| Show all posts
#include<stdib.h>------>#include<stdlib.h>
Reply

Use magic Report

1

Threads

14

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-11-4 14:30:01
| Show all posts
Be careful :)
Reply

Use magic Report

2

Threads

20

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-11-4 15:30:01
| Show all posts
.............stdlib, standard library
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-11-4 17:15:01
| Show all posts
Just take it easy, just be careful
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-11-4 18:45:01
| Show all posts
F:\2题.cpp(3): fatal error C1083: Cannot open include file:'stdib.h': No such file or directory
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list