I don't understand how to use fscanf in C to place data from a text file into an array and also be able to edit the text file as a user from the cli :S (complete noob here..) I tried googling but all that shows up are forums with more problems than solutions and c++ non-examples.
Any help/examples would be greatly appreciated :)
Edit: thanks for the quick responses, I seem to have forgotten to mention that I want to use a 2D array and the txt file contains integers with a space between each following element as well as a new line for each row!
Edit 2: so from what I gather I must use:
- Fscanf ("filename.txt", "rw")
- Create an array[i][j]
- Nested for loop for i and j
- How to get fscanf data into the array?? 5.printf("%d\n", &array[i][j])