Reading from TXT's files 1 by 1

my program needs to read a txt file, download it's data to an object and move on to the next txt file untill the last txt file that passed to the CMD...
I'm using the argc,argv and not so sure about how I'm moving from one txt file 2 another...

How do I do it ?

Thanks a lot 4 all of you
Just repeat the process for every file. I don't see the problem.
This will open an input file for the first argument on the command line:
1
2
3
4
5
6
7
8
9
10
11
#include <fstream>

// ... stuff

std::ifstream ifs; // create file input stream

ifs.open(argv[1]); // open first file from cmd line

// read data into ifs here

ifs.close(); // close file 

Last edited on
Thank you my brother
Topic archived. No new replies allowed.