Expand|Select|Wrap|Line Numbers
- string fix(string str)
- {
- int length = str.size();
- for (int i = 0; i < length; ++i)
- {
- str[i] = tolower(str[i]);
- }
- for (int i = length; str[i] == " " || str[i]==0; --i)
- {
- str.erase(i);
- }
- return str;
- }
ISO C++ forbids comparison between pointer and integerBTW, I am using Dev-C++ if that has anything to do with it.
So my question is, how would I do this? The reason I have to truncate the spaces is I am using getline, and have functions later on that count the length of the string...