title: Data structure that will hold an unknown length of strings and have the ability to remove them later
body: <p>What's the best data structure for storing an unknown amount of values then removing many? </p>
  
  <p>I'm reading a file and each line is stored as a C string in some larger data structure. Each line is probably less than 20 characters long and one example file has 300000 lines. Whatever data structures I'm going to use will only grow in size at it's initial creation; from there it will only shrink in size. What would I use? In Java I would use Array List or maybe Vector. Could a dynamic array work and if yes how would it look like?</p>
  
  <pre><code>char aLine[21];
  char *data = malloc(aLine);
  fp = fopen("datafile", "r");
  if(fp== NULL)
      exit(EXIT_FAILURE);
  while(fscanf(fp, "%20s", aLine) == 1)
  {
      data = aLine;
      realloc(data, sizeof(data)+sizeof(aLine));
  }
  </code></pre>
  
  <p>I want to use standard C and POSIX features so if having lists means usings a third party library I don't think that's an option.</p>
  
  <p>EDIT: well creating a linked list isn't exactly trivial, what's the second best option?</p>