fork(4) download
  1. #include <stdio.h>
  2.  
  3. void foo(int i) { printf("int version\n"); }
  4. void foo(const char* str) { printf("str version\n"); }
  5.  
  6. int main()
  7. {
  8. printf("First foo: foo(NULL)\n");
  9. foo(NULL);
  10.  
  11. printf("Second foo: foo(\"world\")\n");
  12. foo("world");
  13.  
  14. printf("Third foo: foo(\"nullptr\")\n");
  15. foo(nullptr);
  16. }
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
First foo: foo(NULL)
int version
Second foo: foo("world")
str version
Third foo: foo("nullptr")
str version