Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why must we refrain from using conio.h? Is it obsolete? [duplicate]

Tags:

c

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?

like image 219
kotAPI Avatar asked Feb 15 '23 00:02

kotAPI


1 Answers

<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.

like image 88
Paul R Avatar answered Feb 16 '23 14:02

Paul R