I would like to concatenate strings and integers so that i produce something like this:
Code:
char *path " = "/home/myFolder%d/run%d.raw"
//where %d is a integer specifier
so that I can use it in some function
Code:
int min, max, folderNumber;
someFunction(path, min, max);
concatenating....
Code:
char fpath[256];
char fpath1[512];
char *string1 = "/home/myFolder";
char fn[6] = "/run_"
char ext[5] = ".raw";
int start =0;
int end = 10;
for (int ifolder= 0; ifolder<20; ifolder++) {
sprintf(fpath, "%s%d", string1, ifolder);
sprintf(fpath1, "%s%s%d%s", fpath, fn, %d, ext);
//then call someFunction
someFunction(fpath1, start, end); //or
someFunction("/home/myFolder%d/run%d.raw", 0,10);
//the point is doing sprintf(fpath1,....) causes me problems, as I want to append instead the integer variables "start" and "end" in someFunction(fpath1, start, end); I will be do complicated for loops in this function, hence the necessity to do append here
}