delorie.com/archives/browse.cgi | search |
From: | Ryan McGee <don't AT spam DOT me> |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: Printing Strings to the screen? |
Date: | Sat, 20 Dec 1997 13:33:54 -0600 |
Organization: | InLink Communications Company |
Lines: | 23 |
Message-ID: | <349C1DA2.A9E76FCC@spam.me> |
References: | <01bd0d4e$305f3d00$LocalHost AT my-computer> |
NNTP-Posting-Host: | iits02209.inlink.com |
Mime-Version: | 1.0 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
How are you gettting x to equal "Hello World"? If you use cin, it stops after the first space so you have to use cin.get(variable name, number of characters). Ryan RDM AT inlink DOT com Joe Davidson wrote: > I am having trouble printing strings that contain a space within them. > Here what I am trying to do. > > string x = "Hello World"; > cout << x; > And when I compile and run the program it just prints "Hello" > What is it that I am doing wrong? > > Thank's in advance. > > Joe Davidson
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |