Integer-to string conversion and string concatenating

Hi roottalkers,

I would like to convert an integer to a string and then concatenate two strings,
in order to print a canvas to a particularly named postscript file, doing
this in a loop. Searching roottalk archives, I came up with following:

count =0;
while () {

TString fout = “figures/file” + Form("%d",count) + “.eps”;

But, this does not work … ;8-( Anybody sees why, or can propose
an alternative solution?
Regards, Emil


TString fout = "figures/file" + Form("%d",count) + ".eps"; 


TString fout = Form("figures/file%d.eps",count) ; 


Thanks, your suggestion works (though I now see that both our previous
messages have one typo … ;:sunglasses:

                                                                                             Regards, Emil

I have written same code to concatenate bt I get an error which says “+ Illegal operator for pointer 1”