fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. void input_str_to_sngl_commands( char*** commandsArray );
  6.  
  7. int main()
  8. {
  9.  
  10. char** commandsArray_var;
  11. input_str_to_sngl_commands( &commandsArray_var );
  12. printf("%s%s\n", commandsArray_var[0], commandsArray_var[1]);
  13. return 0;
  14. }
  15.  
  16. void input_str_to_sngl_commands( char*** commandsArray )
  17. {
  18. *commandsArray = (char**) malloc(2*sizeof(char**));
  19. (*commandsArray)[0] = (char*)malloc(30*sizeof(char));
  20. strcpy((*commandsArray)[0], "hello, ");
  21. (*commandsArray)[1] = (char*)malloc(30*sizeof(char));
  22. strcpy((*commandsArray)[1], "world!");
  23. }
Success #stdin #stdout 0s 2140KB
stdin
Standard input is empty
stdout
hello, world!