From: Martin Ambuhl Newsgroups: comp.os.msdos.djgpp Subject: Re: Can someone compile this? Date: Tue, 24 Nov 1998 15:42:02 -0500 Content-Transfer-Encoding: 7bit References: <73cifb$gqm$1 AT clam DOT niwa DOT cri DOT nz> <19981124 DOT 12323889 AT eev6 DOT eev> X-Posted-Path-Was: not-for-mail X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-ELN-Date: 24 Nov 1998 20:42:50 GMT X-ELN-Insert-Date: Tue Nov 24 12:45:17 1998 Organization: Nocturnal Aviation Lines: 44 Mime-Version: 1.0 NNTP-Posting-Host: 1cust219.tnt11.nyc3.da.uu.net Message-ID: <365B1A1A.771B6BAE@earthlink.net> X-Mailer: Mozilla 4.5 [en] (Win95; I) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Michael Schuster wrote: > > Hi everyone! > > I'm desperately searching for a bug in my new 2.8.1 djgpp > installation, but cannot find it. > > The problem I face is the damn old String class problem which I posted > already 2 times. > As I want to know, if I do something wrong, I ask you if someone with > a 2.8.1 can compile the following little c++ code (which I cnly can > compile with my 2.7.xx djgpp? > > #include > #include > #include <_String.h> > > String xc="test2"; > char d[25]="dummy"; > > int main() > { > xc=d; > strcpy(d,xc); > cout< } Note that the following will work and may be what you want: #include #include string xc = "test2"; char d[25] = "dummy"; int main() { xc = d; strcpy(d, xc.c_str()); cout << d << endl; } Martin Ambuhl (mambuhl AT earthlink DOT net) Note: mambuhl AT tiac DOT net will soon be inactive