Char string replace
Posted on 2003-03-20
I'm coding for Half-Life and I want to replace every %v in a char with the content of another char (it HAS to be %v). How can I do this?
char* text = new char;
sprintf(text, "Waht is up %v? How come I haven't seen you %v in so long?\n");
text = strtok(text, "%v");
while(text != NULL)
buffer2 += string( text ) + lastseen;
text = strtok(NULL, "%v");
but it replaced all the v's and % signs separately.