www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/13/21:47:09

Message-ID: <002101bf45db$4ff25860$cff0fea9@stevenhe>
From: "Steven C. Hendrickson" <hendrick AT pe DOT net>
To: <djgpp AT delorie DOT com>
References: <3855596D DOT 15459DEE AT pepparkakor DOT demon DOT nl>
Subject: Re: Input?
Date: Mon, 13 Dec 1999 18:31:17 -0800
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
Reply-To: djgpp AT delorie DOT com

You need to have more than just a 'command'.  You need to use something like
this:

 #include <iostream.h>

 int main()
 {
 char name[30];                                // you need to make a space
for your input

 cout << "Enter a name: " << endl;
 cin.getline(name, 30,'\n');                // tell getline where to place
the input, and its size

 cout << "Your name is: " << name << endl;
 return 0;
}

Steve Hendrickson
----- Original Message -----
From: Roger <roger AT pepparkakor DOT demon DOT nl>
Newsgroups: comp.os.msdos.djgpp
To: DJGPP <djgpp AT delorie DOT com>
Sent: Monday, December 13, 1999 12:39 PM
Subject: Input?


> Hi everyone!
>
> I have one question! I know a command in Basic,but I can't use it in
> C++.Could anyone tell me how I make a input-command,so I can for example
> write in a name!
>
> Thanks..
>
>

- Raw text -


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