fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. struct myStruct {
  5. int a;
  6. int b;
  7. int c;
  8. } *myArray;
  9.  
  10. void initialize( int size ) {
  11. myArray = malloc( size * sizeof * myArray );
  12. }
  13.  
  14. void operations( ) {
  15. myArray[1].a = 7;
  16. }
  17.  
  18. int main( ){
  19.  
  20. initialize( 2 );
  21. operations( );
  22.  
  23. printf( "%d", myArray[1].a );
  24. free( myArray );
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0s 2380KB
stdin
Standard input is empty
stdout
7