Path: utzoo!attcan!uunet!husc6!rutgers!bellcore!u1100a!krohn From: krohn@u1100a.UUCP (Eric Krohn) Newsgroups: comp.lang.c++ Subject: Re: OOPS library Strings and char* Message-ID: <2115@u1100a.UUCP> Date: 8 Aug 88 17:19:58 GMT References: <2859@robin.cs.nott.ac.uk> Reply-To: krohn@u1100a.UUCP (Eric Krohn) Organization: Bell Communications Research, Piscataway, NJ Lines: 23 In article <2859@robin.cs.nott.ac.uk> psxgas@nott-cs.UUCP writes: ] Does anyone know how to use the OOPS Strings in standard C++ routines which ] take char* parameters ] ] For the time being, I've adopted the following solution : ] ] filebuf.open((char*) (String_name(0,String_name.length()).ptr()),input); That's rather ugly! I've used both of the following &String_name[0] and str2str (String_name) where str2str is defined as: static const char *str2str (const char *str) { return (str); } Both expressions have type const char *. String_name is, of course, declared to be of type String. -- -- Eric J. Krohn krohn@ctt.ctt.bellcore.com or {bcr,bellcore}!u1100a!krohn Bell Communications Research, 444 Hoes Ln, Piscataway, NJ 08854