i also tested their sizes like this and strName is 1 char bigger
size_t size1 = strName.length(); // size1 = 6
size_t size2 = strNameOne.length(); // size2 = 5
but, doing this before the .compare() test:
strNameOne = strNameOne + '\n';
gave this output
result
jerry
jerry
end fout
So, the strings are the same...but they're not...help ! i'm new with all of this !! Thanks :)
why strName.compare(strNameOne) == 0 instead of the usual strName == strNameOne ?
I guess it's out of habbit. I find it easier to differentiate where the string comparisons are vs integer, float etc. For 'bool' i use 'TRUE, FALSE' for the same reason...
Will it slow down the code much doing it this way ? I don't know how much efficiency I'm losing. Thanks
I find it easier to differentiate where the string comparisons are vs integer, float etc. For 'bool' i use 'TRUE, FALSE' for the same reason...
Dunno why you will want to differentiate those comparisons.
I find quite obfuscated to write if( var==false ) (also note the lowercase, you don't need those macros in c++)