void methodTest(int x){
x=9;
}
int methodTest2(int x){
x=9;
return x;
}
int main()
{
// insert code here...
// 输出字符串到控制台,这个函数声明在stdio.h文件中
printf("Hello, World!\n");
//
int a=10;
methodTest(a);
printf("调用函数methodTest后 a= %d\n",a);
a=methodTest2(a);
printf("调用函数methodTest2后 a= %d\n",a);
return 0;
}
console
Hello, World!
调用函数methodTest后 a= 10
调用函数methodTest2后 a= 9
Program ended with exit code: 0