cout << "Now, you will enter four phrases. It does not matter what order you input your phrases, we will sort them for you after you are finished typing your phrases. Your phrases cannot be more than 130 characters long."
<< "Enter your phrase now: ";
cout << endl << endl;
cin.get (phrase_1, max_length);
cin.ignore (130, '\n');
phrase_1[0] = toupper (phrase_1[0]);
cout << "You entered, " << endl << phrase_1;
cout << endl << endl;
So this allows the user to enter their phrase, not more than max_length (130, set as a constant). My issue is that I go through each phrase like this. I need to be able to use functions to capitalize, look for extra spaces. Not only that I feel that to let the user arrange them in whichever way they feel I'll also need to use a function.
For the next phrase I do:
cin.get (phrase_2, max_length);
cin.ignore (130, '\n');
phrase_2[0]= toupper (phrase_2[0]);
cout << "You entered, " << endl << phrase_2;
cout << endl << endl;
cout << "Now enter, your next phrase.";
Then I thought I could do
two = phrase_2; // This will store the phrase so that later we can
So that each phrase could be stored with an int or char. Then I would let a user enter 1 for one, 2 for two, 3 for three, 4 for four and they could choose the order. Well, it turns out this isn't allowed in c++. You can't store a char array into a char variable.