Path: utzoo!attcan!uunet!cs.utexas.edu!csc.ti.com!ti-csl!ticipa!huggins From: huggins@ticipa.ti.com (Gray Huggins) Newsgroups: comp.lang.c++ Subject: accessors for string vars Message-ID: Date: 12 Sep 90 16:12:11 GMT Sender: news@ticipa.pac.sc.ti.com Distribution: comp Organization: Texas Instruments Process Automation Center Lines: 12 Nntp-Posting-Host: foghorn 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