I'm using C to try and and open a file, then add the lines from the text file into an array one by one. Each would be delimited by the end of line character I think.
I am having the user select the name and location of the text file with scanf and the variable is being held b "userFile".
Then trying to read to an array called "usernames"
readUFile = fopen (userFile, "rt"); fread (usernames, LenOfusernames, 1, readUFile);
Am I going about this the right way or am I better off trying to use to use this or some other call? I'm not very familiar with the options that C has for this sort of thing so I don't even know if I have used fread correctly.
Any suggestions to point me in the right direction would be a great help.
Thanks

New Topic/Question
Reply




MultiQuote





|