Home > Back-end >  How to use C language to multiple TXT file to import into the array
How to use C language to multiple TXT file to import into the array

Time:12-17

The specific question is like this, there are multiple TXT file, respectively is 1. TXT, 2. TXT,... 20. TXT, each file has two columns of data, through the program will each file the first line of the two data displayed, I first think of is to set up multiple file pointer, read different *. TXT file, such as * fp1 open 1. TXT, but many files are in trouble, so have a read automatically from 1. TXT to n.t xt and deposited in a [], [] b... The method of the array? Another difficulty is how to read file will only the two array data import?

CodePudding user response:

The for loop 20 times, each time to read a file,

CodePudding user response:

Don't need multiple file pointer, a can, write a function to read and write configuration files, implement open, every time reading, closed operation, the parameters of the function that the file path and receiving array of arrays,

CodePudding user response:

Can send a code, I do not understand the operation
  • Related