#include<stdio.h>
int sumandMinus(int n1,int n2,int *n3);
int main()
{
int a = 10;
int b = 7;
int he;
int cha;
he = sumandMinus(a,b,&cha)
printf("和是%d,差事%d",he,cha);
}
int sumandMinus(int n1,int n2,int *n3)
{
return n1 + n2;
*n3 = n1 - n2;
}
为什么cha输出的不对,但是如果把函数改体改成这样{
*n3 = n1 - n2;
return n1 + n2;
}结果就对了 |
|