return 作用:
- 返回;
- 函数退出
函数参数传值
#include <stdio.h>
void test(int a)
{
a += 10;
}
int main()
{
int a=0;
test(a);
printf("%d",a);//输出0
return 0;
}
函数的传值–隐式转换
传给函数的值的类型 与函数原型中的参数类型不一致,如果满足隐式转换的规则,类型不一致也可以。
return 作用:
函数参数传值
#include <stdio.h>
void test(int a)
{
a += 10;
}
int main()
{
int a=0;
test(a);
printf("%d",a);//输出0
return 0;
}
函数的传值–隐式转换
传给函数的值的类型 与函数原型中的参数类型不一致,如果满足隐式转换的规则,类型不一致也可以。