首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

简短的C语言,该如何解决

2012-08-16 
简短的C语言#include stdio.hstruct test{int achar *p}aavoid init()void main(){void init()prin

简短的C语言
#include "stdio.h"
struct test
{
int a;
char *p;
}aa;
void init();
void main()
{
void init();

printf("%d\n",aa.a);

}
void init()
{
aa.a=15;
}

为什么无法输出:15

[解决办法]

C/C++ code
#include "stdio.h"struct test{    int a;    char *p;}aa;void init();void main(){    init();        printf("%d\n",aa.a);    }void init(){    aa.a=15;}
[解决办法]
void main()
{
void init();

printf("%d\n",aa.a);

}
这里的void init();改为init();调用函数不用声明

[解决办法]
把你 main 里面的void init();
改成init();

热点排行