fork download
  1. #include<stdio.h>
  2. #include<string.h>
  3. #include<stdlib.h>
  4.  
  5. void get_memory(char **p){
  6. *p = (char *)malloc(100);
  7. return;
  8. }
  9.  
  10. int main(){
  11. char *str = NULL;
  12. get_memory(&str);
  13. strcpy(str, "Hello World!");
  14. printf(str);
  15. return 0;
  16. }
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
Hello World!