No, the reason is that the upper case part is only called if the first character of the string is lowercase.
Printable View
No, the reason is that the upper case part is only called if the first character of the string is lowercase.
>No, the reason is that the upper case part is only called if the first character of the string is lowercase.
I'm referring to this in the original post:
Notice the conspicuous absense of any Upper Case: output.Quote:
s22 "BaLLooN" String Length: 7
Lower Case:
büllÅÅn
Upper Case:
t22 "BaLLooN" String Length: 7
Lower Case:
büllÅÅn
Upper Case:
u22 "BaLLooN" String Length: 7
Lower Case:
büllÅÅn
Upper Case:
Right, that happens because when this runs:m_lower points to the null terminator. Then, when this runs:Code:cout << "Upper Case: "<< m_lower<< endl;
it is false because *m_upper is 'B' which is not lowercase, so the for loop does not get run to convert to uppercase, as CornedBee mentioned.Code:if(islower (*m_upper))
>it is false because *m_upper is 'B' which is not lowercase
Ah yes, I see now.
I have another problem...
I have an overloaded << operator that won't work with external ofstream csis(csis is just a text file)...the errror I"m getting is:
c:\documents and settings\hp_administrator\my documents\visual studio 2005\projects\stringstuff\case.cpp(62) : error C2678: binary '<<' : no operator found which takes a left-hand operand of type 'std::ofstream' (or there is no acceptable conversion)
my simple little function looks like this:
where the declaration is:Code:ostream& operator<<(ostream& os, String& str)
{
os << str.getBuf() << endl;
return os;
}
friend ostream& operator<<(ostream&, const String& str);
Anyone?? Anyone??? I have not the slightest clue.... I hope that's enough information too::