delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/29/09:46:44

From: Charles Krug <charles AT pentek DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: "string" in GnuC++ ???
Date: Mon, 29 Dec 1997 09:03:45 -0500
Lines: 30
Message-ID: <34A7ADC0.640B1A5C@pentek.com>
References: <m0xmOjV-0004nrC AT fwd05 DOT btx DOT dtag DOT de>
NNTP-Posting-Host: mail.pentek.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Stritt wrote:

> Hello!
>
> as the definition C++ says, i can use the type "string", after binding the includefile
> "<list.h>".
>

You also need (AFAIK, always) to include  string.

You should be able to use strings as in your example by simply doing this:

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

int main()
{
    string test("Hello World!\n"0;

    cout << test;
}

--
Charles Krug, Jr.
Application Engineer
Pentek Corp
1 Park Way
Upper Saddle River, NJ 07458


- Raw text -


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