Hello everybody,

I have got a code that read txt file. But I wounder how I can read many text file from a folder and save each one in a separate array.


Help Please

I would create a function that reads a file into an array. The parameters to that function would be the name of the file and the array. Then in main() -- or somewhere else -- call that function as many times as you want to with different parameters each time.

In c++ it would be easier to use a vector instead of a C style array if you can. Depends on what your instructor told you what you have to use.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.