Re: A noob question?
I'm not sure if strlen was working for me so I went and read my textbook and it told me to use string.length() and i've been playing around with it for a little.
I used the header file #include <string> and declared the variables as string (at least I believe I did). I then began using if else to determine how my information would be displayed. At first I was writing:
else if else if (word1.length() > word3.length() > word2.length())
cout << word1 << word3 << word2;
because that is how I understood the book. But I am fairly sure this is incorrect. Can someone please tell me how to do this properly?
|