I have a simple function, that checks if the strings given match a certain condition, then generate a 3rd string based on the 2 ones received as arguments. The 3rd string is fine but when I return it it suddenly turn into "\n
".
string sReturn = "";
if (sText.size() != sPassword.size()) {
//Checks to see if the texts match a condition
return sReturn;
}
for (int foo = 0; foo < sText.size(); foo++) {
sReturn = "";
sReturn += (char)sText[foo] ^ (char)sPassword[foo];
}
return sReturn;
In the for sReturn
is fine and has the right contents, but as soon as it exists the loop, the debugger suddenly tells me it's contents are "\n
". What am I doing wrong ?