[comp.lang.c++] accessors for string vars

huggins@ticipa.ti.com (Gray Huggins) (09/12/90)

What is the recommend approach to handling the accessor methods for instance
variables that are char *?  I think I should set by allocating new memory and
coping the string into my instance variable.  However, how do I protect my
instance variable from harm if on the "get" accessor I return a pointer to
it?

Thanks,
--
Gray Huggins                   Internet: huggins@ticipa.ti.com
Texas Instruments                                          
PO Box 655012  M/S 3635        TI MSG:  GHUG
Dallas, TX 75265               Voice:   (214) 917-2202