I'm using var args in a file i/o function. It works fine unless the string which is wanting to be outputted contains a %
and there are no additional arguments. E.g. the string <name px=100% />
would cause the issue, as an example. The code is roughly as follows:
void OutV(CString s, va_list args)
{
CString formatted;
formatted.FormatV(str, args);
// Do stuff with formatted....
}
Is there a way that I could make it so that having a %
symbol does not cause a problem. Ideally I'd like it inside of the OutV
function above so that it only has to be in one place.
I can't do a simple replace all % with %% as then if there is a %d in there then that still needs to be substituted as an integer.