fork download
  1. # include <stdio.h>
  2.  
  3. struct myStruct
  4. {
  5. char* word;
  6. int num;
  7. };
  8.  
  9. void func_3(struct myStruct *Input){
  10. Input->num = 7; // <- edit struct
  11. Input->word = "some stuff here"; // <- edit struct
  12. printf("This is Input word %s\n", Input->word);
  13. }
  14.  
  15.  
  16. int main(int argc, char const *argv[])
  17. {
  18. struct myStruct aStruct;
  19. func_3(&aStruct); // <- pass here
  20.  
  21. printf("This is my struct's word: %s\n", aStruct.word); // <- print word
  22. printf("This is my struct's word: %c", *aStruct.word); // <- print first char
  23.  
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0s 2008KB
stdin
Standard input is empty
stdout
This is Input word some stuff here
This is my struct's word: some stuff here
This is my struct's word: s