View Single Post
Join Date: Sep 2004
Posts: 7,541
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 704
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: replacement of getch()

 
0
  #10
Sep 28th, 2007
>To anyone reading this thread:
You realize the thread is over three years old, yes?

>getch() is still available in the conio.h header file (at least in MinGW).
I'm sure it works just fine on your compiler, but because it's non-standard, that means it's not guaranteed to work on my compiler, or someone else's compiler. Is this that difficult of a concept for you people to grasp?

>cin.get() acts the same as getchar() - it echos the
>pressed key and waits for enter to be pressed.
Assuming that's what getchar does. getchar makes a call to a system function that performs the actual read, and that system function (whatever it may be) isn't required by the C++ standard to provide cooked input. However, I'll give this to you because I can't think of any systems off the top of my head that don't buffer up to a line feed. It's a safe assumption.

>And don't worry, Narue is wrong
Narue is always right[1]. You'd do well to realize that before truly embarrassing yourself.

>iostream is very standard for C++.
<iostream> is standard, <iostream.h> is not. Once again, this is a very simple concept, but I'll assume that you're just having trouble with reading for comprehension and missed the ".h" part.


[1] I'll qualify this. Narue is always right when it comes to the likes of you. I do make mistakes, but I get the strong impression that you're not a strong enough programmer to notice them or accurately correct me even if you do.
Last edited by Narue; Sep 28th, 2007 at 4:34 pm.
I'm here to prove you wrong.
Reply With Quote