Re: Hi, Sally. Your code is wrong.
Hi, Sally and Sue.
Your code is wrong.
void myfunc (const CString& InString)
{
// do processing here
return OutString;
}
1) If you want to return CString,
CString myfunc(CStrig str)
{
......
return OutString;
}
Or use reference.
void myfunc(CString& InString)
{
CString str("Aha");
InString += str;
}
//In this case, InString is updated without return.
That is,
CString str("First ");
object.myfunc(str);
//now str is "First Aha"
If I have some errors, please point it out.
Regards.
-Masaaki Onishi-
Re: Hi, Sally. Your code is wrong.
CString myfunc(const CString& inString)
{
CString outString;
// do processing here
// like outString = inString + "extra";
return outString;
}
this will work beautifully
Sally
Re: Hi, Sally. Your code is wrong.
Indeed it will. It was your original post that had a void function returning a CString that won't work... :-)
Dave