delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/19/19:16:58

From: "Peter Lewerin" <peter DOT lewerin AT krax DOT pp DOT se>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problem with the string data format!
Date: 19 May 1997 18:19:28 GMT
Organization: -
Lines: 30
Message-ID: <01bc6481$445c7500$6847f482@peterlew>
References: <01bc643c$9a240b00$d541b7c2 AT engineering5 DOT engineering DOT it> <33806a96 DOT 5931584 AT ursa DOT smsu DOT edu>
NNTP-Posting-Host: dialup71-5-4.swipnet.se
NNTP-Posting-User: s-36170
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Tony O'Bryan <aho450s AT nic DOT smsu DOT edu> skrev i inlägg
<33806a96 DOT 5931584 AT ursa DOT smsu DOT edu>...
> On 19 May 1997 10:01:51 GMT, "Lorenzo Soncini" <lsoncini AT mbox DOT linknet DOT it>
wrote:
> 
> >	How can I use the string data type with DJGpp ?
> 
> there is no string data type per se in DJGPP (or C for that matter).  

True, but there *is* a string class in (the working paper for) C++, and
it's implemented in the C++lib for DJGPP.  It's declared in the header
std/string.h, which in turn uses the declaration for basic_string from
std/bastring.h.

I suppose you would use it like this:

#include <iostream.h>
#include <std/string.h>

int main()
{
   string s("Hello world!");
   cout << s << endl;
   return 0;
}

(On my system, this works when compiled with gxx, but not when compiled
with RHIDE (no errors even with RHIDE, though).)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019