hi guys, im trying to read a text file and get one word at a time.
e.g : i want to eat ice- cream, i'd like to eat chocolate and maybe a lolipop!
will display
i
want
to
eat
ice
cream
i'd
like
to
eat
chocolate
and
maybe
a
lolipop
i figure i would nid to use fget to store the characters in a buffer and scan each line for every character. while i understand how to print the text in a while, i have no idea how to scan each character to achieve my results. can someone explain to me please?
Code:while(fgets(entry, sizeof(entry) , myfile)) { printf("%s",entry); }