Skip to content
← Back to Community
conio.h C++
Profile icon
PasAdam

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

Voters
Profile icon
AnastasiiaGolik
Profile icon
SHUBHAM-SHARMAS
Profile icon
JULIAN-DAVIDD28
Profile icon
AntonStankov
Profile icon
CarlosHernand52
Profile icon
Newtindocotil
Profile icon
FERNANDODAVIDD6
Profile icon
ManuelSanGT
Profile icon
Fedesimon
Profile icon
talalkanjo
Comments
hotnewtop
Profile icon
mat1

Can you please leave a link to your code?

Profile icon
PasAdam
Profile icon
Giothecoder

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

Profile icon
PasAdam

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

Profile icon
Giothecoder

@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?

Profile icon
Giothecoder

@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();

Profile icon
PasAdam

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

Profile icon
Giothecoder
Profile icon
PasAdam
Profile icon
Giothecoder

@PasAdam awesome :)

Profile icon
AkshayaS4

@Giothecoder
this is the first time i am using replit so can u tell where i can find input.hpp or how i can go to that