Page 1 of 1

String parameter for my method/function?

PostPosted: Sun Jun 19, 2011 12:34 am
by Zehper48
Code: Select all
void changeText(string newtext){

}



This is my code, i want to use a string as a parameter, but when i use this in the global code it says
Unknown type 'string': possible old C type declaration

how do i use a string as a parameter?
Thank you :)

Re: String parameter for my method/function?

PostPosted: Sun Jun 19, 2011 12:36 am
by Hblade
void NewText(char *textactor, char *newtext) {
sprintf(&textactor, &newtext);
}

i think that'll work, its untested though, sorry :P

if that doesn't work change the void line to:

void NewText(char textactor[256], char newtext[256]) {