Re: C++ help [message #276628 is a reply to message #276620] |
Wed, 01 August 2007 18:28 |
Sn1per74*
Messages: 939 Registered: April 2006
Karma:
|
Colonel |
|
|
[quote title=Cat998 wrote on Wed, 01 August 2007 19:34][quote title=Sn1per74* wrote on Thu, 02 August 2007 01:41]Cat998 wrote on Wed, 01 August 2007 11:22 |
Example:
Quote: | char *message "!kick Sn1per74 C++ newb";
char buf[512]; //buffer for the function
char **toks;
toks = strtokenizer(message, buf, 3, ' '); //function call
Console_Output("%s has been kicked out of the game for: %s", toks[1], toks[2]);
//kick code here
delete[] toks; //cleanup
|
So toks[0] contains word1 (!kick), toks[1] contains word2 (Sn1per74) and toks[2] contains the rest of the string
|
Good example.
Creator: AoBFrost
|
|
|