My current code is:
char* message = new char[256];
cin.getline(message, 256);
if(message[0] == 's' && message[1] == 'a' && message[2] == 'y' && message[3] == ' ')
{
cout << message << endl;
}
I am trying to have it setup so it will only print if the first 4 characters are ‘say ‘ and it works fine however I need to figure out a way for it to remove ‘say ‘ as well so it only shows what the person wanted to well say. Bare in mind for what I am doing it has to be a char I cannot use a string in the situation I am in. If anyone can help me figure out how to do this I will be very grateful thanks.
Simply print
message + 4And then rewrite it to use std::string.