It is compiler dependent in C. It is never safe to depend on the order of evaluation of side effects. For example, a function call like below may very well behave differently from one compiler to another:
There is no guarantee (in either the C or the C++ standard language definitions) that the increments will be evaluated in any particular order. Either increment might happen first. func might get the arguments `2, 3′, or it might get `3, 2′, or even `2, 2′.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Does C support function overloading?
- How can I return multiple values from a function?
- What is the purpose of a function prototype?
- Importance of function prototype in C
- What happens when a function is called before its declaration in C?
- C function argument and return values
- Address of a function in C or C++
- strrev() function in C
- strcmpi() function in C
- getopt() function in C to parse command line arguments
- How to return multiple values from a function in C or C++?
- strnset() function in C
- time() function in C
- clock() function in C/C++
- toupper() function in C
- tolower() function in C
- strlwr() function in C
- Inline function in C
- putchar() function in C
- getdate() and setdate() function in C with Examples