c语言问题 程序改错

来源:百度知道 编辑:UC知道 时间:2024/06/22 17:27:44
#include "stdio.h"
#include "conio.h"
struct addr
{ char name[30];
char street[40];
char city[20];
char state[3];
char tell[11];
struct addr*next;
};
void main()
{
char s[80],choice;
struct addr*info;
start=last=NULL;
for(;;)
switch(menu_select())
{ case 1:enter();
break;
case 2:deleted();
break;
case 3:search();
break;
case 4:exit(0);
}
}

int menu_select()
{ char s[80];
int c;
printf("1_Enter a name\n");
printf("2_Delete a record\n");
printf("3_Search\n");
printf("4_Quit\n");
do
{ printf("\n Enter your choice:");
gets(s);
c=atoi(s);
}while(c<1||c>4);
return(c);
}

void enter()

#include "stdio.h"
#include "conio.h"
struct addr
{ char name[30];
char street[40];
char city[20];
char state[3];
char tell[11];
struct addr *next;
};
struct addr *start;
struct addr *last;
int menu_select()
{ char s[80];
int c;
printf("1_Enter a name\n");
printf("2_Delete a record\n");
printf("3_Search\n");
printf("4_Quit\n");
do
{ printf("\n Enter your choice:");
gets(s);
c=atoi(s);
}while(c<1||c>4);
return(c);
}
void enter()
{ struct addr*info;
void inputs(char*,char*,int);
int n;
for(n=0;;n++)
{ info=(struct addr*)malloc(sizeof(struct addr));
if(info==NULL);
{ printf("\n out of memory");
return;
}
inputs("ente