Opening a sequence of files inside a loop
Posted: Sun Jul 19, 2009 7:57 pm
Hi,
I need to open a sequence of files named as bitmapXX.bmp (where XX= 0... 99) inside a 'for' loop, access them and then close at the end of iteration.
something like below.
for (i=0; i<100; i++)
{
//open file
//access
//close
}
I tried to use strcat and itoa but I have a problem when I have generate a number with proceeding 0...for example for 1, it generates bitmap1.bmp instead of bitmap01.bmp.
Can you please help?
Kevin
I need to open a sequence of files named as bitmapXX.bmp (where XX= 0... 99) inside a 'for' loop, access them and then close at the end of iteration.
something like below.
for (i=0; i<100; i++)
{
//open file
//access
//close
}
I tried to use strcat and itoa but I have a problem when I have generate a number with proceeding 0...for example for 1, it generates bitmap1.bmp instead of bitmap01.bmp.
Can you please help?
Kevin