title: Reading multiple files, and keeping a set of data for each file.
body: <p>I want to read a file and save its header in a variable so that when I am rewriting(overwriting) that file, I can just paste the header and carry on with printing the rest of the modified file. The header, in my case, does not change so I can afford to just print it out. Here is my code inside the class:</p>
  
  <pre><code>.
  .
  .
  static char headerline[1024];
  
  static int read(const char* filename){
  fget(var,...;
      for (int i=0; i&lt;1024; ++i){
          headerline[i] = var[i];
      }    
  .
  .
  .
  }
  
  int write(filename){
  fprintf(filename, headerline);
  //printing rest of file
  .
  .
  .
  }
  </code></pre>
  
  <p>The code successfully prints the line it saved while reading the file. However, my problem is that it saves the header of the file it read the last time. So if i have two files opened and I want to save the first one, then the header of the second file is written to the first one. How can I avoid that? If static map is a solution, what exactly is that?</p>
  
  <p>Secondly, what would be the best way to print the whole header(5-8 lines) instead of only one line as I am doing now.</p>