0
What is the correct order for the calling function of the code given below?
a=f1(23,14)*f2(12/4)*f3();
4 Respostas
+ 6
Adding to my reply, the order of which function is executed first, is unspecified. Although we know that * has left to right associativity, it is dependent on the compiler whether or not it would execute f1 first, or f2.
https://en.cppreference.com/w/c/language/eval_order
+ 5
As stated in:
https://en.cppreference.com/w/c/language/operator_precedence
Both () and * operator has a left-to-right associativity. () has higher precedence, so the function calls are resolved accordingly before the values are multiplied and assigned to a.
+ 1
Akshay just to go off track, it doesn't matter in which order function is called... all function call is call by value and all return value is multiplied to get answer, order doesn't matter for this output...
0
Ketan Lalcheta Ketan Lalcheta I wanted to know how memory allocation sequence is decided for above functions.