TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JASON HULME
from: VIRGIL GARNESS
date: 1997-05-24 05:16:00
subject: cin errors

Hi Jason,
-> if an char value is inputed into a cin << input, where input is defined as 
-> a float my program goes "crazy" All inputs after the cin .. are not 
-> accepted. Is there a way to get around this? I plan to have a window pop 
up 
-> and say "Invalid amount please redo"
-> I have tried:
-> if (input!=float) cout <<"invalid";
->                        ...but the program still exectued the same.
try:
if (input !==float)
 cout << "invalid";
In your case of this I beleive you are trying to assign the value of
float to input.
-> Another problem I am havings is reading a float value for a file using 
-> _dos_read. The only content of the file is 123.45 but when dos_read reads 
-> this value is returns 123.45\x1. What does \x1 mean?
This is an unprintable character '\x###' is the Hexadecimal equivelent
(1 or more hexadecimal digite specifing the interger value of the
desired character) not sure if that is the character it is returning or
the interger itself.
Are you using a C or C++ compiler?
Hope this helps
till Later.....
--- Platinum Xpress/Win/Wildcat5! v2.0
---------------
* Origin: Al's Force BBS 44-1638-532437 Fido 2:2501/206 (2:2501/206)

SOURCE: echomail via exec-pc

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™.