I wanna use the getch() function,but the judge system said that "01767330_24.c:4:19: conio.h: No such file or directory".
Please tell me how to solve the problem if u know.Thank u!
conio.h: No such file or directory
Moderator: Board moderators
-
- New poster
- Posts: 22
- Joined: Sun Oct 20, 2002 6:41 pm
- Location: Lithuania
- Contact:
I wonder if there's a function that exactly like getch()?
fuction such as cin.get(),getchar() will wait for "enter".Is there a function that will reflect immediately when i input a simple character?
fuction such as cin.get(),getchar() will wait for "enter".Is there a function that will reflect immediately when i input a simple character?
"Learning without thought is useless;thought without learning is dangerous."
"Hold what you really know and tell what you do not know -this will lead to knowledge."-Confucius
"Hold what you really know and tell what you do not know -this will lead to knowledge."-Confucius
it does wait for a newline in case you are inputting from console. In case your standard input is redirected from a file then it will get you next character without any problems. <conio> functions are especially done for console io, to add functionality. getchar waits for enter because so you can change entered data. But with redirected standard input it will simply use line buffering. It will internally buffer till a newline. And will give you requested character without any delay.
Ivor
P.S. When I solve problems I always use redirected input. A lot more silmpler.
Ivor
P.S. When I solve problems I always use redirected input. A lot more silmpler.
There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.