Message-ID: <39535192.2280CFA3@earthlink.net> From: Martin Ambuhl Organization: Nocturnal Aviation X-Mailer: Mozilla 4.73 [en] (Win95; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: string class? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 61 Date: Fri, 23 Jun 2000 12:00:23 GMT NNTP-Posting-Host: 63.23.128.204 X-Complaints-To: abuse AT earthlink DOT net X-Trace: newsread1.prod.itd.earthlink.net 961761623 63.23.128.204 (Fri, 23 Jun 2000 05:00:23 PDT) NNTP-Posting-Date: Fri, 23 Jun 2000 05:00:23 PDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com markbatty AT freeuk DOT com wrote: > > I can see from the FAQ's there seems to be a problem with the string class. Can you double check this for me. You have confused the C header with the C++ header . See the corrected code, which compiles without error and runs properly, below: #include /* mha - was */ #include /* mha - is a C header, for which the corresponding C++ header is . It has nothing to do with the C++ functionality */ using namespace std; class play { public: play(const string & n); ~play(); void disp() const; private: string name; }; play::play(const string & n):name(n) { cout << "play ctor" << endl; } play::~play() { cout << "play dtor" << endl; } void play::disp() const { cout << name << endl; } int main() { play p1("Mark"); p1.disp(); return 0; } -- Martin Ambuhl mambuhl AT earthlink DOT net What one knows is, in youth, of little moment; they know enough who know how to learn. - Henry Adams A thick skin is a gift from God. - Konrad Adenauer