title: My array is being overwritten with the same values?
body: <p>so I have an array that keeps getting overwritten with new values. For example, this is the output: </p>
  
  <pre><code>instruc[0] = PRINTNUM
  instruc[1] = PRINTNUM
  instruc[2] = PRINTNUM
  </code></pre>
  
  <p>where PRINTNUM is supposed to be the last thing in the array and the first two elements are supposed to be something else.</p>
  
  <p>Here is my code for the specific segment: </p>
  
  <pre><code>    //array of instructions
  char** instruc = malloc(numLines * 200); 
  
  c = fgets(inputString, 200, in_file);
  
  while (c != NULL){
      instruc[i]=inputString;     
      i++;
      c = fgets(inputString, 200, in_file);
  }
  
  //print out what's in the array
  i=0;
  for (i=0; i&lt;numLines; i++){
      printf("instruc[%d] = %s\n", i, instruc[i]);
  }
  </code></pre>
  
  <p>Thanks in advance!</p>