|
我在调试iii.c错误时始终都 不对,请各位指点一下。小妹在此谢过了。
///*以下为iii.c程序*///
#include<stdio.h>
#include<stdlib.h>
#define BIGNUM 5000
void index_to_the_moon(int ary[]);
void main(void)
{int intray[100];
index_to_the_moon(int ary[]);
exit(EXIT_SUCCESS);
}
void index_to_the_moon(int ary[])
{int i;
for(i=0;i<BIGNUM;++i)
ary=i;
}
编译过程如下:
[sunny@GQ ~]$ gcc -ggdb3 -o cs iii.c
iii.c: In function 'main':
iii.c:8: error: syntax error before 'int'
iii.c:7: warning: return type of 'main' is not 'int'
iii.c:16:2: warning: no newline at end of file
[sunny@GQ ~]$ gdb iii core
GNU gdb 6.3-5mdk (Mandriva Linux release 2006.0)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i586-mandriva-linux-gnu"...iii: 没有那个文件或目录.
/home/sunny/core: 没有那个文件或目录.
(gdb) [sunny@GQ ~]$ gcc -ggdb3 -o cs iii.c
iii.c: In function 'main':
iii.c:8: error: syntax error before 'int'
iii.c:7: warning: return type of 'main' is not 'int'
iii.c:16:2: warning: no newline at end of file
[sunny@GQ ~]$ gdb iii core
GNU gdb 6.3-5mdk (Mandriva Linux release 2006.0)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i586-mandriva-linux-gnu"...iii: 没有那个文件或目录.
/home/sunny/core: 没有那个文件或目录.
(gdb) break main
No symbol table is loaded. Use the "file" command.
(gdb) break 15
No symbol table is loaded. Use the "file" command.
(gdb)
显示的总是不对,我是哪里写错了。大家快点拔一下 |
|