From: bowman AT montana DOT com (bowman) Newsgroups: comp.os.msdos.djgpp Subject: Re: Converting a string to a char * References: <840i65$auc$1 AT bob DOT news DOT rcn DOT net> User-Agent: slrn/0.9.5.7 (UNIX) Lines: 14 Message-ID: Date: Sat, 25 Dec 1999 01:55:18 GMT NNTP-Posting-Host: 208.4.224.19 X-Trace: newsfeed.slurp.net 946086918 208.4.224.19 (Fri, 24 Dec 1999 19:55:18 CDT) NNTP-Posting-Date: Fri, 24 Dec 1999 19:55:18 CDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Andrew R. Gillett wrote: >> *b = *s.c_str(); > >Change this to: > >strcpy (b, s.c_str()); b is a pointer to char. s.c_str() returns a pointer to char. So, b = s.c_str() would work. Doing a strcpy of some arbitrarily long string to a pointer that was never initialized will dump core and die, if you are lucky.