fgets reads a whole line only. You will have to break the line up into words using something like strtok. Google for examples. If you need more complex parsing of the line, it would probably be...