为什么c=2而不等于3啊?C++
为什么c=2而不等于3啊?
#include <stdio.h>
int f(int i){return ++i}
int g(int &i){return ++i}
int h(char&i)(return ++i}
main()
{
int a=0,b=0,c=0;
a+=f(g(a));
b+=g(g(b));
c+=f(h(c));
print("a=%d,b=%d,c=%d",a,b,c);
}
为什么c=2而不等于3啊?
#include <stdio.h>
int f(int i){return ++i}
int g(int &i){return ++i}
int h(char&i)(return ++i}
main()
{
int a=0,b=0,c=0;
a+=f(g(a));
b+=g(g(b));
c+=f(h(c));
print("a=%d,b=%d,c=%d",a,b,c);
}