- #1
Moe
- 56
- 0
I have the following problem: My program is supposed to read data from files to an array. The files are numbered: file1.dat, file2.dat and so on. There are 24 of those files, and I really don't want to do the same step 24 times. Is there a way to write a loop along the lines of
for (int i=1; i<25, i++);
{
fstream myfile("C:\Data\file(i).dat")
...
}
In other words, is there a way to insert the "i" variable into the filename?
Thank you for your insights.
for (int i=1; i<25, i++);
{
fstream myfile("C:\Data\file(i).dat")
...
}
In other words, is there a way to insert the "i" variable into the filename?
Thank you for your insights.