X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Message-ID: <3C0C2775.BF99D0A6@sensor.com> From: Ron Natalie Organization: Sensor Systems X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en,pdf MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp,comp.lang.c++,alt.comp.lang.learn.c-c++ Subject: Re: More than one letter input References: <91509768 DOT 0112031721 DOT 1481a4ee AT posting DOT google DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 23 X-Complaints-To: abuse AT usenetserver DOT com X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly. NNTP-Posting-Date: Mon, 03 Dec 2001 20:22:57 EST Date: Mon, 03 Dec 2001 20:31:33 -0500 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Person wrote: > > > It only takes the first letter of the name. That's because char is only big enough to hold one letter. Furthermore, you're lucky you got that far (your program is non-standard. If you want to read a string, use a string type. #include #include using namespace std; int main() { string name; cout << "Name: "; cin >> name; cout < "Hello, " << name << "\n"; }