Ajay
Ajay

Reputation: 61

c++ alternative for getch() and clrscr()

I use code::blocks 10.05 for compiling C++.

But I cannot use

getch()

It says unknown. When I #include <conio> it says unknown library. So what is the alternative to be able to use getch in C++?

Upvotes: 0

Views: 3353

Answers (2)

MohdRash
MohdRash

Reputation: 123

Header files with .h extension are different from those without h extension , you may refer this C++ includes with and without .h

Upvotes: 1

imslavko
imslavko

Reputation: 6676

Try #include <conio.h>

Works fine on my machine (Windows and Linux, mingw compiler for Windows). As I know Code::Blocks uses gcc compiler.

Upvotes: 2

Related Questions