fork(1) download
  1. #include <stdlib.h>
  2. #include <string.h>
  3. #include <stdio.h>
  4.  
  5. int main (int argc, char *argv[]) {
  6. struct {
  7. int a;
  8. char *s;
  9. } s = {
  10. .s = malloc (100),
  11. .a = 10
  12. };
  13.  
  14. strcpy (s.s, "hello");
  15.  
  16. int arr[argc];
  17. for (int i = 0; i < argc; i++) {
  18. arr[i] = s.a;
  19. }
  20. printf ("%s %d\n", s.s, arr[0]);
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 2424KB
stdin
Standard input is empty
stdout
hello 10