Maybe I'm misunderstanding the question but this seems appropriate: std::cout << "Input 10 words of 5 letters each: ";
You have to be including iostream to use std::cout of course.
no no, i know how to do that!
the question is how do i make an array that only accepts 10 words with 5 letters each and then sort them in alphabetical order!
thanks anyway!
thank you!!!
im just a little confused, i don't see how it works!
if you have time, can you elaborate?
i really appreciate all the time you are spending on this! =D
A zero value indicates that both strings are equal.
A value greater than zero indicates that the first character that does not match has a greater value in str1 than in str2; And a value less than zero indicates the opposite.
Hope I helped :)
Edit:
As for
im just a little confused, i don't see how it works!
what it does is loop the user 10 times in order to input a value. (hence the for(int i = 0; i < 10; i++)
The user inputs a string and
1 2 3 4 5
if(strlen(Input) != 5)
{
std::cout << "\nPlease Use Words 5 Characters Long\n";
i--; //i--; is to undo the increase of i;
}
checks that the length of the input is 5, if not the user is asked to enter another string.
(Also I would suggest an array of strings if you intend to compare the strings string str[5];)