Ask coding questions

← Back to all posts
conio.h C++
PasAdam (1)

Why #include <conio.h> is not working? And how can I make it work?

Commentshotnewtop
Giothecoder (13)

That is not a portable header. In fact it is not part of the standard. Try to avoid conio.h.

PasAdam (1)

@Giothecoder ok, but i need it to use getch();

Giothecoder (13)

@PasAdam hm.. not necessarily. There was someone a while back who actually did manage unbuffered input in c++, if you give me a bit I can probably find it. It was called dungeon crawl or something like that?

Giothecoder (13)

@PasAdam found something better I think, https://repl.it/talk/share/NON-BLOCKING-UNBUFFERED-CONSOLE-INPUT-in-C/17428

Edit: if you go to input.hpp, literally the first thing there is an implementation of getch();

PasAdam (1)

thank you @Giothecoder, I will try to do something with it