title: Defining a struct with file scope to be accessed by multiple functions
body: <p>I have two functions.
  1. Defines the data structure based on the inputs.
  2. Uses the defined structure.</p>
  
  <p>How can I define the structure in one function, and be able to use it in another function later?</p>
  
  <pre><code> struct myStruct{
          int a;
          int b;
          int c;
       };
  
   void initialize(int size){
       struct myStruct myArray[size];
   }
  
   void operations(){
        myArray[1].a = 7;
   }
  </code></pre>
  
  <p>These are defined in an external file, and the inputs and outputs are set and shouldn't be changed. Is there a way to make my array of structs accessible later by a different function?</p>
  
  <p>EDIT: Attempting to assign this to a pointer.</p>
  
  <pre><code>struct myStruct{
          int a;
          int b;
          int c;
       };
   struct cache_entry *p;
   void initialize(int size){
       struct myStruct myArray[size];
       *p = &amp;myArray;
   }
  
   void operations(){
        myArray[1].a = 7;
   }
  </code></pre>