This week's book giveaway is in the Testing forum. We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line! See this thread for details.
short simple stumper: reading doubles from the cli
John M. Gabriele
posted 15 years ago
Here's a short program that's supposed to read positive doubles in from the command line as the user types 'em in and hits enter. It's got some very strange behaviour. First, the code:
If I run it on the NT system at work, here's a sampling of what the exchanges look like on the command line:
and it goes on like this without breaking out of the while loop. Very peculiar... worth a few thoughts anyhow. Stranger still, the file that gets written to looks pretty much right. It doesn't contain those itsy-bitsy numbers noted above but it does however contain the sdfsa letters... Yes, I realize that when I open theFile.txt with notepad, notepad simply looks at the bytes and interprets them as iso-latin ascii and displays 'em as such... Although I don't know how it get's the carriage return/newlines correct...(?) Let me know if anybody see's what I'm not. Thanks.
[This message has been edited by john gabriele (edited August 03, 2001).]