c++ - unexpected output in function calls -
I have a program in which I have implemented the main function as the following and finally i get the unexpected value of i I am here.
int main () {int fun (int); Int i = 3; Fun (i = Fun (Fun (i))); Printf ("% d", i); Return 0; } and my function implementation
int (int i) {i ++; Return (i); } My output is:
5 What did I expect:
6
i = funny (i = funny (funny I))); This will give you 6
funny (i = funny (funny (i))); This gives 5 because the last call does not specify the value to i.
Apart from this, as mentioned below by Tom mentioned in the context of value, if you have passed from context, then it will be 6 if you have fun (fun (fun Fun (and &)); (what functions / depending on parameter type).
Comments
Post a Comment