Concatenation with loadImage

How could I do a concatenation with the source of an image (and generally in C++) ?
In a javascript-way-of-thinking it would be this :
image.loadImage("0" + indexImage + ".jpg");

what did you try? is it working? if not, which error are you receiving?

Hi, I guess that indexImage is a number. you need to convert it to a string before concatenating it with other strings. The following should work.

image.loadImage("0" + ofToString(indexImage) + ".jpg");

if indexImage is an int you will still be able to concatenate it to a string but it will not be the literal number of the int rather the character value that it represents (like in the ascii table).

Thank you I didn’t think that I have to convert it into a string! It works well now.