jewee
asked on
Convert blank string to reference
I have a function which returns a reference to a string(std::string). How do I go about returning a reference to a blank string if certain conditions are not met?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
std::string *SomeFunction(arguments here)
You can always return a NULL pointer if function fails, just
(inside function)
return NULL;
(outside function)
std::string *aString=SomeFunction(argu
if (aString!=NULL) {
// some action here
}