String Form

Dear experts,

do you know why [1] is not working? I have the error message [2].


int ntree
Form("!H:!V:NTrees=%i:MinNodeSize=5%:MaxDepth=3:BoostType=AdaBoost:SeparationType=GiniIndex:nCuts=20:VarTransform=Decorrelate", ntree) )

warning: unknown conversion type character 0x9 in format [-Wformat=]
Form("!H:!V:NTrees=%i:MinNodeSize=5% t:MaxDepth=3:BoostType=AdaBoost:SeparationType=GiniIndex:nCuts=20:VarTransform=Decorrelate", ntree) );

…The problem is coming from the “5%” because if I remove the “%” it compile. So why the escape “” does not work?


It works the same as printf in C:

root [10] cout << Form("Form test = %f %%",50.) << endl;
Form test = 50.000000 %

Dear Couet,

it worked.