This looks right to me. Note that charInput is an std::string. I also didn't post all of the code since it is quite large, and these are the only 2 functions you really need to see.
Code:
void CTextFunc::getInput()
{
ba("");
std::getline(cin, charInput);
if(boolInputLimit==true){
if(strlen(charInput.c_str())<=usintCharInputLimit){
exec(charInput.c_str());
getInput();
} else {
ban("Error! Your command is to long!");
ba("The maximum amount of character's allowed is \'");
sprintf(charIntBuffer, "%i", usintCharInputLimit);
b(charIntBuffer);
bn("\'");
getInput();
}
} else {
exec(charInput.c_str());
}
}
void CTextFunc::exec(const char* charString)
{
strtok (charString," ");
getInput();
}
Of course the exec function doesn't work since charString is is a const char*, and I can't figure out how to convert it into a char*. Could you show me an example with using strtok then?