fork(3) download
  1. #include <iostream>
  2.  
  3.  
  4. void foo ( long) { std::cout << "int\n " ; }
  5.  
  6. void foo ( int* ) { std::cout << "int*\n " ; }
  7.  
  8. //void foo ( std::nullptr_t ) { std::cout << "nullptr\n " ; }
  9.  
  10.  
  11. int main() {
  12. foo ( NULL ) ;
  13. //foo ( nullptr ) ;
  14. }
Compilation error #stdin compilation error #stdout 0s 3340KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:12:16: error: call of overloaded ‘foo(NULL)’ is ambiguous
     foo ( NULL ) ;
                ^
prog.cpp:12:16: note: candidates are:
prog.cpp:4:6: note: void foo(long int)
 void foo ( long) { std::cout << "int\n " ; }
      ^
prog.cpp:6:6: note: void foo(int*)
 void foo ( int* ) { std::cout << "int*\n " ; }
      ^
stdout
Standard output is empty