ifstream Myfile("tests000.txt");
int trow=0;
int trow0=0, trow1=0, trow2=0, trow3=0, trow4=0, trow5=0, trow6=1;
int tcol;
if(Myfile.is_open()) //opens dictionary
{
while(!Myfile.eof())
{
getline(Myfile, lines);
................etc.
however i need to load files that are all going to be named test00*.txt so like test001, test002, test003. how would i change this to make it load the present one in the same dir, and not just the test000.txt? thanks
If you know the amount of files there are going to be you could do something like.
1 2 3 4 5 6 7 8 9
int numberOfFiles = 10;
for(int i = 0; i < numberOfFiles; i++)
{
char fileName[128];
sprintf(fileName, "test00%d.txt", i );
ifstream MyFile(fileName);
/* use the file ... */
}