How can I import data from a text file into a two-dimensional array?
Example Data would be
A.01 C Song 1
B.01 C Song 2
B.02 G Song 2.1
etc.
How can I import data from a text file into a two-dimensional array?
Example Data would be
A.01 C Song 1
B.01 C Song 2
B.02 G Song 2.1
etc.
Use fgets() to read each line.
Use sscanf() or other string functions to parse the line and extract data into the row elements of your 2D array.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Could you perhaps give me some code examples?
I could, but there are umpteen examples on the board already, and I think you need to spend longer than 5 minutes before asking for more help.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.