| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 407 人关注过本帖
标题:求助!程序调试!! 谢谢!!
只看楼主 加入收藏
晓寒忆梦
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-10-25
收藏
 问题点数:0 回复次数:4 
求助!程序调试!! 谢谢!!
有两个错误如下:error C2601: 'DeleteRecord' : local function definitions are illegal
F:\xhyprogram\通讯录管理.cpp(115) : fatal error C1075: end of file found before the left brace '{' at 'F:\xhyprogram\通讯录管理.cpp(73)' was matched
搜索更多相关主题的帖子: 调试 
2007-10-25 10:24
hmxh1984
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2007-9-10
收藏
得分:0 

看不懂


杀 杀 人 跳 跳 舞
2007-10-27 17:26
晓寒忆梦
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-10-25
收藏
得分:0 

不怪你看不懂,应该是我自己没有把原程序发上去吧!仍然感觉你对我帖子的关注,谢谢!

2007-10-28 11:20
pwtt
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-9-12
收藏
得分:0 
hehe!要是想让大家帮忙,还是把程序发上来啊!
2007-10-28 12:54
晓寒忆梦
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-10-25
收藏
得分:0 

谢谢你,我的程序如下,耽误你们宝贵的时间帮我看看。谢谢!!!
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define N 100
typedef struct invetory
{char name[16];
int NO;
char mobile[20];
char hometele[15];
char sex;
}INVE;
void displayMenu();
int choiceItem(void);
void input(INVE inv[],int n);
int search(INVE inv[],int n);
int DeleteRecord(INVE inv[],int
void AlterRecord(INVE inv[],int n);
main(){
INVE inv[N];
int choice;
choice=choiceItem();
do{switch(choice)
{case 1:input(inv,N);
case 2:search(inv,N);
case 3:DeleteRecord(inv,N);
case 4:AlterRecord(inv,N);
}
}while(choice!=0);
printf("\n Exit!!");
}
void displayMenu()
{printf("\n=======Menu======\n");
printf("\n1........input information\n");
printf("\n2.........search information\n");
printf("\n3.........delete information\n");
printf("\n4.........alter information\n");
printf("\n0......Exit\n");
printf("\nChoice:");
}
int choiceItem(void)
{int choice;
char line[80];
do{
displayMenu();
gets(line);
choice=atoi(line);
}while(choice<0||choice>4);
return choice;}
void input(INVE inv[],int n)
{int i;
printf("\nEnter the information:");
for(i=0;i<n;i++)
scanf("%d%s%s%s%s",&inv[i].NO,inv[i].name,inv[i].mobile,inv[i].hometele,inv[i].sex);
printf("\n");
printf("\ndisplay input information:");
for(i=0;i<n;i++)
printf("\n%d%s%s%s%s",inv[i].NO,inv[i].name,inv[i].mobile,inv[i].hometele,inv[i].sex);
}
int search(INVE inv[],int n)
{int key,i=0;
printf("\nEnter the search key:");
scanf("%d",&key);
if(key<0||key>n)return 0;
else {while(i<n)
{if(inv[i].NO==key)
printf("\nthe searching information is %d%s%s%s%s",inv[i].NO,inv[i].name,inv[i].mobile,inv[i].hometele,inv[i].sex);
else i++;
}
return 1;
}
int DeleteRecord(INVE inv[],int n)
{int key,i=0,j;
printf("\nplease enter a key:");
scanf("%d",&key);
if(key<0||key>n)return error;
else{while(i<n)
{if(inv[i].NO==key)
{j=i+1;printf("the delete record is %d%s%s%s%s",inv[i].NO,inv[i].name,inv[i].mobile,inv[i].hometele,inv[i].sex);}
else i++;
}
n--;
printf("After deleteing dejust other records:");
for(j=i+1;i<n;j++)
{inv[j-1].NO=inv[j].NO;
inv[j-1].name=inv[j].name;
inv[j-1].mobile=inv[j].mobile;
inv[j-1].hometele=inv[j].hometele;
inv[j-1].sex=inv[j].sex;
}
printf("After dejusting the new order:");
for(i=0;i<n;i++)
printf("\nthe new order is %d%s%s%s%s\n",inv[i].NO,inv[i].name,inv[i].mobile,inv[i].hometele,inv[i].sex);
}
void AlterRecord(INVE inv[],int n)
{int key,i=0;
printf("\n Enter a key:");
scanf("%d",&key);
if(key<0||key>n)printf("there is no this record.");
else {while(i<n)
{if(inv[i].NO==key){
printf("please dispaly the old record:");
printf("\n%d%s%s%s%s",inv[i].NO,inv[i].name,inv[i].mobile,inv[i].hometele,inv[i].sex);
printf("\nplease input new information:");
scanf("%d%s%s%s%s",&inv[i].NO,inv[i].name,inv[i].mobile,inv[i].hometele,inv[i].sex);
}
else i++;
}
}

printf("After alter the whole new records:");
for(i=0;i<n;i++)
printf("%d%s%s%s%s\n",inv[i].NO,inv[i].name,inv[i].mobile,inv[i].hometele,inv[i].sex);
}

2007-10-28 19:34
快速回复:求助!程序调试!! 谢谢!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.050505 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved