Use of conio.h file in c
It contains routines that are specific to the DOS command line. One function here that's frequently used is getch , which allows reading one character at a time without having to press the Enter key. It also contains gotoxy which allows placing the cursor at a specific location in the terminal. Generally speaking, methods of communicating with the terminal like this are very OS specific, so each has their own typically non-portable way of doing it.
This contrasts with the functions in stdio. It has functions that are not provided by the standard library, and people who choose it don't know to care about porting to other systems. What do functions inside of conio. Because you've been taught to use it, and you don't know to care about porting to other systems.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Why use conio. Ask Question. Asked 1 year, 11 months ago. Active 9 months ago. Viewed 8k times. What is the reason to choose functions of conio. Why to choose the conio library? Another name of the function Function: getche Return Value of the function This function returns the next standard input character read without displaying error.
Example Code. Return Value This function returns a pointer which points at buffer[2], this returns no error. Return Value of the Function A return value of this function is characters to be printed on the screen. Ofcourse, Like this. Return Value of the Function If the function returns 0 then it is executed successfully otherwise it is executed unsuccessfully. Return Value of the Function This function returns the converted fileds.
These prototypes just clean up some syntax checks and code generation. Other functions of conio. Return Value of the Function This function returns 1 on success and 0 when no error occurs. Color codes are taken from enum as defined in conio. Text color is taken from following enum. Programming Line 16th September Load More. It formats strings and displays strings on the console. The conio stands for Console-Input-Output.
The conio. Here we have explained some of the important and most widely used functions of conio. Click on each function to navigate through each function. Note: Use Turbo C compiler to compile and execute conio. Using this function you can clear the output command window.
On the command prompt, we usually print code execution status, error information, and output results. During the code execution, if you want to clear the existing printed information on the output console then you can use clrscr function. Use this function to read characters from the keyboard. This function is also used to hold the output screen until the user enters any character.
The getch is a non-standard function provided by conio.
0コメント