来帮忙看看这道C语言的题

来源:百度知道 编辑:UC知道 时间:2024/05/21 10:11:44
#include <stdo.h>
void Func (void);
main()
{
int i;
for (i=0;i<2,i++)
{ Func (c);
}}
void Fumc (void)
{ int times=1;
printf("Func ()was called %d time(s).\n",times++);}

#include <stdio.h>
for (i=0;i<2;i++)

#include <stdio.h>
//你头文件写错了
void Func (void);
main()
{
int i;
for (i=0;i<2;i++)
//第二个“i<2”后面应该是分号
{
Func ();
//fun()这个函数里面不应该写c,因为你定义的返回void
}
}
void Func (void)
//这里的func被你写成fumc
{
int times=1;

printf("Func ()was called %d time(s).\n",times++);

}
//修正完毕

结果是:

Func ()was called 1 time(s).
Func ()was called 1 time(s).
Press any key to continue

//因为执行两次,所以输出两行

//你可能问:为什么第二个不是2time(s)

这是因为:func定义是返回void,外部的i只能让它执行两次。

看不懂,你Func(c)中的c没有定义过 怎么使用??且你的调用函数中的void是什么意思?? 无返回值?

#include <stdo.h>
int times = 1;
void Func (void);
main()
{
int i;
for (i=0;i<2,i++)
{ Func ();
}}
void Fumc (void)
{
printf("Func ()was called %d time(s).\n&q