TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Shane Day
from: David Nugent
date: 1994-08-18 00:24:36
subject: scanf() gets() me confused

> JS> No more quick'n'dirty functions for me.  It really threw me when
 > JS> the problem manifested itself differently when I removed the
 > JS> array and made it a single record.

 > It is a bit of a bugger.  I've had the same problem when
 > using cin.  After using a cin.get(char*,int,int) I've found
 > it is necessary to do a cin.get() after _every_ cin call.

Then use istream::getline(), where the '\n' is automatically discarded, or
better yet, define a string class which allows you to accept and parse the
precise object you're looking for.  There's little point in using an OOP
language unless you're going to follow the same philosophy.

---

* Origin: Unique Computing Pty Ltd (3:632/348)
SEEN-BY: 50/99 54/54 620/243 623/630 624/50 632/103 301 348 365 386 998
SEEN-BY: 633/371 379 634/384 635/210 502 503 541 544 636/100 639/100 711/409
SEEN-BY: 711/430 807 808 809 932 934 712/623 713/888 714/906 800/1
@PATH: 632/348 635/503 50/99 54/54 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™.