fork(2) download
  1. int set_val(char **a)
  2. {
  3. *a=(char *)malloc(sizeof(char)*4);
  4. *(*a)='x';
  5. *(*a+1)='y';
  6. *(*a+2)='\0';
  7. printf("%s\n",*a);
  8. return 0;
  9. }
  10.  
  11. int main()
  12. {
  13. char * a=NULL;
  14. set_val(&a);
  15. printf("%s",a);
  16. return 0;
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int set_val(char**)’:
prog.cpp:3: error: ‘malloc’ was not declared in this scope
prog.cpp:7: error: ‘printf’ was not declared in this scope
prog.cpp: In function ‘int main()’:
prog.cpp:13: error: ‘NULL’ was not declared in this scope
prog.cpp:15: error: ‘printf’ was not declared in this scope
stdout
Standard output is empty