Advertisement
Archon

Function call evaluation order

Dec 19th, 2010
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2.  
  3.  
  4. typedef void (*func_t)(int x);
  5.  
  6. void func(int x){
  7.    std::cout << "evaluate function    ";
  8. }
  9.  
  10. func_t f(){
  11.    return &func;
  12. }
  13.  
  14.  
  15. int x(){
  16.    std::cout << "evaluate arg    ";
  17.    return 5;
  18. }
  19.  
  20.  
  21. int main(){
  22.    while(true){
  23.       f()(x());
  24.       std::cout << std::endl;
  25.    }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement