I am working on a String compare program and i got the program to work properly i was just wondering how to put user input into quotes.
here is my programming
const int LENGTH = 40;
char s1[LENGTH], s2[LENGTH];
cout << "== String Compare ==" << endl;
cout << "Enter a word" << endl;
cout << "Enter another word" << endl;
if(strcmp(s1, s2) < 0)
cout << s1 << " comes before " << endl;
else if (strcmp(s1, s2) > 0)
cout << s1 << " comes after " << endl;
cout << "Words are exactly the same" << endl;
the input is :
the output needs to look like this:
"Dorito" comes before "dorito".
Last edited on