title: How would I compare a string (entered by the user) to the first word of a line in a file?
body: <p>I am really struggling to understand how character arrays work in C.  This seems like something that should be really simple, but I do not know what function to use, or how to use it.</p>
  
  <p>I want the user to enter a string, and I want to iterate through a text file, comparing this string to the first word of each line in the file.</p>
  
  <p>By "word" here, I mean substring that consists of characters that aren't blanks.</p>
  
  <p>Help is greatly appreciated!</p>
  
  <p>Edit:
  To be more clear, I want to take a single input and search for it in a database of the form of a text file.  I know that if it is in the database, it will be the first word of a line, since that is how to database is formatted.  I suppose I COULD iterate through every single word of the database, but this seems less efficient.</p>
  
  <p>After finding the input in the database, I need to access the two words that follow it (on the same line) to achieve the program's ultimate goal (which is computational in nature)</p>