I'm trying to build a function that compacts the sprintf function, but somehow I ran into the following problem:
The first line after calling the class (It used to be a function, but that didn't work either) I get the correct result: http://puu.sh/1m1Bw
But the line after I get something completely different, while I didn't even touch the class or the variable: http://puu.sh/1m1BR
Can someone explain to me what's happening here?
Edit: Forgot the actual class:
StringCreator::StringCreator(char* _parten, ...) {
char buff[255];
va_list args;
va_start (args, _parten);
vsprintf (buff,_parten, args);
va_end(args);
this->str = buff;
}
And in the .h file:
class StringCreator {
public:
StringCreator(char* _parten, ...);
char* str;
};