4

I have started programming in C a few years ago. The two most commonly used header files were <conio.h> and <stdio.h>. All my favourite functions for clearing the screen clrscr() the infamous getch() function from stopping the window from terminating after it completes etc.

A few years later after I've attended a class regarding programming languages and practices, I've been asked to refrain from using the conio.h header file. Is using conio a bad practice in modern programming? What's the reason? why are people so anti-C against using the good old C libraries?

kotAPI
  • 1,073
  • 2
  • 13
  • 37

1 Answers1

9

<conio.h> is non-standard and non-portable. Use a cross-platform library such as ncurses if you need functionality not provided by the standard C libraries.

Paul R
  • 208,748
  • 37
  • 389
  • 560
  • But is ncurses usable on windows? [GNU ncurses page](http://www.gnu.org/software/ncurses/ncurses.html) lists it in "Future Plans" section. – user694733 Jan 24 '14 at 10:01
  • It certainly seems to be: http://gnuwin32.sourceforge.net/packages/ncurses.htm – Paul R Jan 24 '14 at 10:03
  • 1
    Can I use it on Visual Studio 2010? Does it support additional functions compared to `conio`? – kotAPI Jan 24 '14 at 10:03
  • Yes to both questions: it does a lot more than `conio`, e.g. text windows. – Paul R Jan 24 '14 at 10:05