E
ern
I'm using it like this:
char * _command = "one two three four";
char * g_UserCommands[4];
const char * delimeters = " ";
g_UserCommands[0] = strtok(_command, delimeters);
g_UserCommands[1] = strtok(g_UserCommands[0], delimeters);
g_UserCommands[2] = strtok(g_UserCommands[1], delimeters);
g_UserCommands[3] = strtok(g_UserCommands[2], delimeters);
//Then I print each entry of g_UserCommands.
When I run this thing, it will just print out one one one one...
I can't figure out what I'm doing wrong...
char * _command = "one two three four";
char * g_UserCommands[4];
const char * delimeters = " ";
g_UserCommands[0] = strtok(_command, delimeters);
g_UserCommands[1] = strtok(g_UserCommands[0], delimeters);
g_UserCommands[2] = strtok(g_UserCommands[1], delimeters);
g_UserCommands[3] = strtok(g_UserCommands[2], delimeters);
//Then I print each entry of g_UserCommands.
When I run this thing, it will just print out one one one one...
I can't figure out what I'm doing wrong...