-3

I am having an assignment and am writing a program for it. I am using clear() and getch() functions inside my program. When I compile the program I get the following error:

Fatal error: conio:no such file or directory 

I have inserted the following line at the beginning of my file:

#include <conio>

Please help me solve this problem.

user5585189
  • 19
  • 1
  • 1
  • This is unanswerable because you've left out a lot of important information. Did you try to include `conio` or `conio.h`? What is your target OS? (see http://stackoverflow.com/questions/8792317/why-cant-i-find-conio-h-on-linux) – Michael Nov 21 '15 at 09:15
  • Well.... you might be using GNU C++ Compiler to execute your code. In GNU compiler there is no conio.h header file. See, the conio.h header file is present only in Turbo C++ IDE. So try other equivalent methods to do same thing – Rahul Raina Nov 21 '15 at 09:15
  • Try `#include `. – KernelPanic Nov 21 '15 at 09:20

2 Answers2

7

I guess whoever gave you that assignment is using Turbo C++. Turbo C++ is way back when the C++ language was not standardized. The header file conio.h is not in any of today's modern compilers. You should look for alternative methods of getch() such as cin.ignore() and please don't use Turbo C++ for any of your programs. If your instructor/teacher is using the same, please advise him/her against it. Use modern compilers such as g++ or Visual C++ to do your C++ programming. You are very much outdated on your standards.

-1

You can use it.

#include <conio.h>
Albert
  • 29
  • 1
  • 5