Sprintf and TLegends

Hi all,

I am trying to feed a string into a splitline TLegend in the following way

char firstline[128];
char secondline[128];

sprintf(firstline,"Blah");
sprintf(secondline,"MoreBlah");

 TLegend *leg = new TLegend(0.25,0.65,0.40,0.85,"","brNDC");
  leg->AddEntry(MyHisto,"#splitline{firstline}{secondline}","lp");
leg->Draw();

but its just printing quite literally “firstline” and “secondline”, how do I get it to expand those strings?

thanks

J

leg->AddEntry(MyHisto, TString::Format("#splitline{%s}{%s}", firstline, secondline), "lp");

thank you much!

J