load images in a loop

How can i load images into an array?

  
    for (int i = 13; i <= 182; i++) {  
       ofImage *img = new ofImage();  
       img->loadImage("testFrames/frame"+%03i+".png");  
       images.add(img);  
}  

They also need leading zeros since there numbered like “frame013.pn” etc.

Since you know the size of the array (182 - 13), you can just use a vector.

  
  
std::vector<ofImage> images(182-13);  
for(int i = 0; i < images.size(); ++i)  
{  
	images[i].loadImage("testFrames/frame"+%03i+".png");  
}  
  

thanks!

how can i do the number format?

This:
%03i

doesn’t work, it says expected expression.