X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: "J.W. Dare" Newsgroups: comp.os.msdos.djgpp Subject: Re: strings Date: 14 Dec 2001 23:47:07 -0600 Lines: 39 Message-ID: References: NNTP-Posting-Host: 216.40.2.67 X-Trace: 1008395089 newscene.com 216.40.2.67 216.40.2.67 Filter-NNTP-Posting-Host: 216.40.2.67 Filter-X-Trace: 1008395089 newscene.com 95066 216.40.2.67 X-Newsreader: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Fri, 14 Dec 2001 20:46:51 -0600, "Derek" wrote: >I can't seem to get strings to work with DJGPP. I'm sure there's a simple >solution. Could someone please point me in the right direction? > >Here's what I tried: > >#include >#include > >int main() >{ > string word = "test"; > cout << word << endl; > return 0; >} > >When I compile it, I get: > >Error: 'string' undeclared (first use this function) > >I tried many things and nothing worked. This is mind boggling. Would you >mind pointing out what I'm doing wrong? Change the #include to #include If you're using the latest DJGPP, based on gcc 3.02 then you'll also need to either add the line using namespace std; or else reference the string type as std::string -- J.W.Dare jwdare AT novia DOT net