Jul 10, 2012 at 4:17pm UTC
Yes. Not just a string. It can return any kind of object that you can define.
Jul 10, 2012 at 6:41pm UTC
I have a counter question: Is there anythin you CAN'T have a member function return???
Jul 10, 2012 at 7:20pm UTC
I'm getting the error "string does not name a type" but when i comment the member function out. my program runs perfectly fine. Do you guys have any idea what this error means and what could be causing it?
Jul 10, 2012 at 7:23pm UTC
Do you include string header file in header part of the file where you declare and implement your class, myClass?
Jul 10, 2012 at 7:29pm UTC
#include <string> is included both in the header file and the implementation file.
Jul 10, 2012 at 8:02pm UTC
And did you remember to specify the namespace?
Jul 10, 2012 at 8:35pm UTC
Try the following
Jul 11, 2012 at 7:56am UTC
@ToniAz: Can ANY function return an array? Any kind of array? No, just pointers! I meant, is there something you CAN return from a global function, but mnot from a member function!
Last edited on
Jul 11, 2012 at 7:57am UTC