void main(void)
{
int n = 4;
n = fun(&n);
printf("%d",n);
}
int fun(int *n) //函数实现
{
*n = 5;
return *n;
}
编译器不会报错,有三个警告,运行结果也正确。警告如下:
...warning C4047: 'function' : 'int ' differs in levels of indirection from 'int *'
... warning C4024: 'fun' : different types for formal and actual parameter 1
...warning C4028: formal parameter 1 different from declaration