how to use string in va_start?
- by Newbie
for some reason, i cant get this working:
void examplefunctionname(string str, ...){
...
va_start(ap, str.c_str());
nor do i 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 this does:
void examplefunctionname(const char *str, ...){
...
va_start(ap, str);
could someone show me how i can use string instead of const char * there?
its outputting random numbers when i call examplefunctionname("%d %d %d", 1337, 1337, 1337)