are there gotchas controlling varargs anxiety parameters


i have square formula (summarized)...



ansistring working(ansistring format,...)
{
va_list argptr;
ansistring buff;

va_start(argptr, format);
buff.vprintf(format.c_str(), argptr);

va_end(argptr);
relapse buff;
}


and, basement pass anxiety comparison where possible, i altered thusly.



ansistring broken(const ansistring &format,...)
{
... rest, totally relating ...
}


my job formula this:-



ansistring s1, s2;
s1 = working("hello %s", "world");
s2 = broken("hello %s", "world");


but, s1 contains "hello world", while s2 "hello (null)". i cruise due proceed va_start works, nonetheless i'm accurately certain what's going on.



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?