I'd like to write a class member function which takes no parameters but returns a string. It would be used to return formatted text containing values of member variables in a class. The call might be used something like:
Because I don't want any parameters, I don't think I can return either a pointer or a reference (only local automatic variables in the function), but I can't see how else I can return a string of characters, as opposed to a single character. Is this possible, and if so what should the return type for the function be?
Thanks (and apologies if I accidentally posted a partially completed version of this question).