title: Changing the size of a global array in the main function
body: <p>I am writing a program that needs to create a variable number of linked lists. The following is declared globally at the beginning of the program:</p>
  
  <pre><code>struct Node
  {
      int Line;
      struct Node *Next;
  } ;
  
  struct Node* Heads[5];
  struct Node* Currs[5]; 
  
  int NumOfNames;
  </code></pre>
  
  <p>The first function in <code>main()</code> will calculate and store a value for <code>NumOfNames</code>. I then need the size of <code>Heads[5]</code> and <code>Currs[5]</code> to be changed to <code>Heads[NumOfNames]</code> and <code>Currs[NumOfNames]</code> in order to create <code>NumOfNames</code> amount of linked lists. Can anything along these lines be done? </p>
  
  <p>I am quite new to programming and my knowledge of <code>malloc</code> and <code>realloc</code> is very poor, but I think I somehow need to use these functions in order to achieve my goal.</p>
  
  <p>Thank you for any advice in advance.</p>