I am trying to read from file into an array. I know I need to read until I hit a space (' ')
and then when I hit the end of the line ('\n')
skip to the next line. I am not sure how to do this. I tried reading until (array != ' ')
but this does not seem to work. Any tips?
Input:
SALESMAN MONTH PROGRAM WRITE
SEE THE BLUE SKY
CAT THROUGH A RAN
THE TOP TUMBLED TO
WHENEVER WATER WAS WHITE
CHARLES CHECK CHEERS CHEAP
A BLUE CLEAR SKY
PAIR PAUL PETER PHILLIP
ADELE CARY DAVID ELAINE
TABLE CHAIR BED DOG