for some reason I can't get this to work:
void examplefunctionname(string str, ...){ ... va_start(ap, str.c_str());
and I do not get this work:
void examplefunctionname(string str, ...){ ... int len = str.length(); char *strlol = new char[len+1]; for(int i = 0; i < len; i++){ strlol[i] = str[i]; } strlol[len] = 0; va_start(ap, strlol);
but it does:
void examplefunctionname(const char *str, ...){ ... va_start(ap, str);
can someone show me how i can use string instead of const char * there?
the output of its random numbers when calling examplefunctionname("%d %d %d", 1337, 1337, 1337)
c ++
Newbie
source share