TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Bill Patterson
from: Dave Looney
date: 1995-10-01 01:14:00
subject: Cset ++

Bill Patterson Wrote:

BP> Sometimes the simplest things are the hardest. I'm 
BP> converting some of my code from "C" to "C++"
using Cset ++. 
BP> So far so good... except for one little problem. I can't 
BP> seem to find a way to accept JUST a carriage return. 
BP> cin.get() won't return just a CR as far as I can tell. Nor 
BP> will cin.read().
BP> 
BP> cout << "\n\n  Hit return when ready\n";
BP> cin.ipfx(0);
BP> cin.get(mychar);

Borland C++ does just as you wish with the following:
char ch;
cout << "\n\n  Hit return when ready\n";
while (ch!='\n') cin.get(ch);

Dave Looney
[Team OS/2]

___
 X KWQ/2 1.2b X Windows is fne for Hih Sped Communicatns ...

--- Maximus/2 2.02
* Origin: OS/2 Connection {at} Mira Mesa, CA (1:202/354)
SEEN-BY: 270/101 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 202/354 300 777 3615/50 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.