I am trying to figure out how to get an input value from a text file rather than from a user, using arrays. Any help is greatly appreciated.
I am trying to figure out how to get an input value from a text file rather than from a user, using arrays. Any help is greatly appreciated.
Look at the last post I made in Jeremy Duncan's thread. That's how to get a sentence, one by one, from a text file.
You need to decide how you want to get the text, and what kind of an array you want to put the text into. fgets() is excellent for row by row kind of logic, The example I just posted, shows how you can use fgetc(). (The punctuation was removed in the example, but that's not necessary, of course)