2 fred233 fred233 于 2015.07.01 12:03 提问

急!用C语言编的一个学生籍贯信息记录簿出现问题

用c语言编了一个学生籍贯信息记录簿,发现只要进行一次修改或删除操作,全部信息输出(allselect函数)时,开头就会有学号为-842150451,姓名为屯屯屯屯屯屯,籍贯为屯屯屯屯屯屯的一项,每进行一次就会多出一项,为什么?
能帮忙修改一下吗? 是allselect(全部输出)函数的问题? 还是jgedit(修改)和jgdelete(删除)这两个函数的问题?

这是代码的链接:
用vc6编的,默认后缀cpp
帮忙修改一下这段代码吧

8个回答

fred233
fred233   2015.07.01 21:20
已采纳

问题已与他人联系解决

u014263809
u014263809   2015.07.01 12:07

int 类型没有初始化变量

kongshuai19900505
kongshuai19900505   2015.07.01 13:18

Line 18: error: conio.h: No such file or directory//#include "" ->>#include <>
cc1plus: warnings being treated as errors
In function 'void jgnew()':
Line 69: warning: deprecated conversion from string constant to 'char*''
In function 'void jgxmselect()':
Line 89: warning: format '%ld' expects type 'long int*', but argument 2 has type 'int*'
Line 98: error: 'getch' was not declared in this scope//getchar
compilation terminated due to -Wfatal-errors.

fred233
fred233   2015.07.01 13:21

Line 18: error: conio.h: No such file or directory//#include "" ->>#include <>
cc1plus: warnings being treated as errors
In function 'void jgnew()':
Line 69: warning: deprecated conversion from string constant to 'char*''
In function 'void jgxmselect()':
Line 89: warning: format '%ld' expects type 'long int*', but argument 2 has type 'int*'
Line 98: error: 'getch' was not declared in this scope//getchar
compilation terminated due to -Wfatal-errors.

这段不用管的,用vc6打开是没错的,错误不是出在这里,话说真的没人能帮我改一下源代码吗?

fred233
fred233   2015.07.01 13:20

Line 18: error: conio.h: No such file or directory//#include "" ->>#include <>
cc1plus: warnings being treated as errors
In function 'void jgnew()':
Line 69: warning: deprecated conversion from string constant to 'char*''
In function 'void jgxmselect()':
Line 89: warning: format '%ld' expects type 'long int*', but argument 2 has type 'int*'
Line 98: error: 'getch' was not declared in this scope//getchar
compilation terminated due to -Wfatal-errors.

这段不用管的,用vc6打开是没错的,错误不是出在这里,话说真的没人能帮我改一下源代码吗?

guonan198811
guonan198811   2015.07.01 13:59

hh!=0 这个判断条件你看看有没有问题,话说每次每次修改后都有随机赋值的现象出现,应该是第一次或者最后一次循环的时候条件控制不对,没有对初始值或者最终值进行设定

ivanx_cc
ivanx_cc   2015.07.01 14:54

给你的 jgEdit 函数 添加一个参数 FILE * fp, 函数内部去掉 打开的代码, Edit OK,
你的delete 本身代码就存在问题,建议你在看看 单链表的删除操作, 修改一下

fred233
fred233   2015.07.01 15:47

能在源代码的基础上进行修改吗?我已经给出链接了

Csdn user default icon
上传中...
上传图片
插入图片