void函数是没有返回值返回给调用函数,还是不接受被调用函数返回的值
是空函数,没有返回值,或者 return;
就行,这个没有返回值返回给调用函数。
这个可以接受被调用函数返回的值。举个例子:
int f1() {
return 10;
}
void f2(int t) {
printf("%d\t", t * 100);
}
//main函数中:
int main()
{
f2(f1(10));
return 0;
}
当然是没有返回值了
int s1(int a, int b)//int表示返回值为整型
{
return a +b;
}
void s1()//void表示底下函数体里面没有要返回的值,只需要打印出来helloworld即可
{
printf("helloworld \n");
}
void函数不能有返回值,但是可以写return;