Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!swrinde!emory!att!watmath!watserv1!pdevries From: pdevries@watserv1.waterloo.edu (Peter DeVries) Newsgroups: comp.lang.c++ Subject: operator const char *( ) Keywords: strings Message-ID: <1990May4.181507.28611@watserv1.waterloo.edu> Date: 4 May 90 18:15:07 GMT Distribution: comp Organization: University of Waterloo Lines: 35 as an added item to the discussion about what to do with the conversion operator 'char *' in a string class. Can I use String::operator const char *(etc.) I am trying to figure out a way to stop the use of something like. String s("hello"); char buf[20] = "hi there"; strcpy(s,buf); from overwriting the internal character string in the string class if the internal char * is returned from the conversion operator. I just don't understand the nuances of returning a separate copy of the character string from the conversion operator.... Peter DeVries Mutual Life of Canada c/o mgardi@watdcsu (519) 888-3523 (416) 972-0594 My opinions/comments are mine, and mine only, and have nothing to do with what Mutual Life of Canada thinks (now isn't that an understatement!) p. -- Peter DeVries Mutual Life of Canada c/o mgardi@watdcsu (519) 888-3523