fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. char *funA()
  6. {
  7. return NULL;
  8. }
  9.  
  10. void funB(char **para_val)
  11. {
  12. *para_val = (char *)malloc(sizeof(100));
  13. strcpy(*para_val, "Hello World");
  14. }
  15.  
  16. int main()
  17. {
  18. char *temp = funA();
  19. if (temp == NULL)
  20. {
  21. funB(&temp);
  22. }
  23. printf("%s\n", temp);
  24. }
  25.  
Runtime error #stdin #stdout 0.01s 1852KB
stdin
Standard input is empty
stdout
Hello World