1. Home >
  2. Apps >
  3. Groups >

Difference between stdio.h and conio.h

Question asked by Akhil Vijay in #Coffee Room on Sep 9, 2015
Akhil Vijay
Akhil Vijay 路 Sep 9, 2015
Rank E1 - BEGINNER
Can anyone please let me know the difference between stdio.h & conio.h and where & when these header files should be used? Posted in: #Coffee Room
PROSENJIT
PROSENJIT 路 Sep 9, 2015
Rank E1 - BEGINNER
Akhil Vijay
Can anyone please let me know the difference between stdio.h & conio.h and where & when these header files should be used?
You write [HASHTAG]#include[/HASHTAG] and [HASHTAG]#include[/HASHTAG] in a C or C++ program to "include" the files "stdio.h" or "conio.h" into your program. It's the same as opening those files in an editor, and copy/pasting them into your program at the point where the [HASHTAG]#include[/HASHTAG] statement is.
contain some functions prototypes like printf(), scanf(), cout,cin.
contain some functions prototypes like clrscr(), getch(), getche() etc.
To find these files, look in the compiler's install directory, in the lib sub-directory. Just don't change anything in these directories, because they are a part of the compiler and run-time library. 馃榾
Akhil Vijay
Akhil Vijay 路 Sep 10, 2015
Rank E1 - BEGINNER
PROSENJIT
You write [HASHTAG]#include[/HASHTAG] and [HASHTAG]#include[/HASHTAG] in a C or C++ program to "include" the files "stdio.h" or "conio.h" into your program. It's the same as opening those files in an editor, and copy/pasting them into your program at the point where the [HASHTAG]#include[/HASHTAG] statement is.
contain some functions prototypes like printf(), scanf(), cout,cin.
contain some functions prototypes like clrscr(), getch(), getche() etc.
To find these files, look in the compiler's install directory, in the lib sub-directory. Just don't change anything in these directories, because they are a part of the compiler and run-time library. 馃榾
Thank you very much. Is it necessary to use both the header files in every program that we do?
Sanyam Khurana
Sanyam Khurana 路 Sep 10, 2015
Rank B1 - LEADER
Akhil Vijay
Can anyone please let me know the difference between stdio.h & conio.h and where & when these header files should be used?
STDIO means Standard Input Output. It has some pre-defined functions like int printf(), scanf() etc. CONIO stands for Console Input Output which has some functions like clrscr(), getch() etc.

Akhil Vijay
Thank you very much. Is it necessary to use both the header files in every program that we do?
conio.h header file isn't used anymore. It was used in old Turbo C compiler which are 16-bit and all your programs run virtually on 8086 microprocessor. So, if you understand how the memory is divided in 8086, you will un-leash must of the logic C uses internally.

Do not use Turbo C, use gcc or something that uses wrapper to gcc like CodeBlocks IDE.

Also, your header files should not be placed like:
[HASHTAG]#include[/HASHTAG]
[HASHTAG]#include[/HASHTAG]

// rest of the program

The proper way to do this would be:

[HASHTAG]#include[/HASHTAG]

using namespace std;

// rest of the program.

I hope this would be a good pointer for you.
Akhil Vijay
Akhil Vijay 路 Sep 10, 2015
Rank E1 - BEGINNER
Sanyam Khurana
STDIO means Standard Input Output. It has some pre-defined functions like int printf(), scanf() etc. CONIO stands for Console Input Output which has some functions like clrscr(), getch() etc.


conio.h header file isn't used anymore. It was used in old Turbo C compiler which are 16-bit and all your programs run virtually on 8086 microprocessor. So, if you understand how the memory is divided in 8086, you will un-leash must of the logic C uses internally.

Do not use Turbo C, use gcc or something that uses wrapper to gcc like CodeBlocks IDE.

Also, your header files should not be placed like:
[HASHTAG]#include[/HASHTAG]
[HASHTAG]#include[/HASHTAG]

// rest of the program

The proper way to do this would be:

[HASHTAG]#include[/HASHTAG]

using namespace std;

// rest of the program.

I hope this would be a good pointer for you.
Sanyam Khurana
STDIO means Standard Input Output. It has some pre-defined functions like int printf(), scanf() etc. CONIO stands for Console Input Output which has some functions like clrscr(), getch() etc.


conio.h header file isn't used anymore. It was used in old Turbo C compiler which are 16-bit and all your programs run virtually on 8086 microprocessor. So, if you understand how the memory is divided in 8086, you will un-leash must of the logic C uses internally.

Do not use Turbo C, use gcc or something that uses wrapper to gcc like CodeBlocks IDE.

Also, your header files should not be placed like:
[HASHTAG]#include[/HASHTAG]
[HASHTAG]#include[/HASHTAG]

// rest of the program

The proper way to do this would be:

[HASHTAG]#include[/HASHTAG]

using namespace std;

// rest of the program.

I hope this would be a good pointer for you.
Thank you very much for the info.
pratap singh, upendra
pratap singh, upendra 路 Sep 10, 2015
Rank C2 - EXPERT
Sanyam Khurana
STDIO means Standard Input Output. It has some pre-defined functions like int printf(), scanf() etc. CONIO stands for Console Input Output which has some functions like clrscr(), getch() etc.
Could you please shed some light on the difference between Standard Input Output and Console Input Output?
Just give the striking difference between them. Technical details are not required as of now.
pratap singh, upendra
pratap singh, upendra 路 Sep 10, 2015
Rank C2 - EXPERT
PROSENJIT
To find these files, look in the compiler's install directory, in the lib sub-directory. Just don't change anything in these directories, because they are a part of the compiler and run-time library
Are header files really a part of compiler?

As per my knowledge, they are a part of run-time library where the developers have written codes that could be used by the programmers instead of reinventing the wheel.
Correct me if I am wrong...
Suresh Babu
Suresh Babu 路 Jan 23, 2017
Rank E1 - BEGINNER
stdio.h is part of c language standard library header. conio.h is an additional library header file provided by BORLAND TURBO C. There are some common functions between these two libraries.
rajmanisha
rajmanisha 路 Jul 8, 2017
Rank E1 - BEGINNER
stdio.h is the header of c programming language which means Standard input output. It has pre-defined functions like int printf(), scanf() etc. conio.h is Console Input Output which include functions like clrscr(), getch() etc.
Chebet Sarah
Chebet Sarah 路 Jan 22, 2020
Rank D1 - MASTER

To start with conio.h header file is deprecated. It was used in old 16-bit compilers running on an 8086 microprocesser. Conio.h stands for Console Input & Output.Header file. It includes functions like khbit(), cgets(), cscanf(), putch(), cputs(), cprintf(), clrscr(), and getch().

Stdio.h is short name of Standard Input & Output Header file. It is basically used to access different macros, functions to perform input and output. stdio.h includes basic functions such as printf, scanf, getc(), gets(), getchar(), puts(), putchar(), clearerr(), fopen(), fclose(), getw(), putw(), fgetc(), putc().

Durgesh Srivastava
Durgesh Srivastava 路 Jan 22, 2020
Rank C1 - EXPERT

Stdio.h- It stands for standard input and output header file. It has definitions of functions like printf() and scanf(). It takes and input from user and displays output either in a file or console.聽

Conio.h- It stands for console input and output. It also does the same as for stdio.h but operates only via console, includes functions like clrscr() (Clears the Screen), getch() (it holds the screen until and input from keyboard is received)聽


Vinay Mishra
Vinay Mishra 路 Jan 22, 2020
Rank B2 - LEADER

Stdio.h-聽 It stands for the standard I/O header file. It contains definitions of functions like printf(), scanf(). It works to take input and give output either in a file or in the console.

Conio.h-聽It stands for the console I/O header file.聽It contains definitions of functions same as stdio.h but only can be operated by the console. It is used in the software like TURBO C, and DOS.

Mohana Chandra
Mohana Chandra 路 Jan 22, 2020
Rank C1 - EXPERT

Header files are also known as preprocessor directives.

Stdio.h : Standard Input Output header file,which provides a large number of library functions. Most widely used are,printf(),scanf().

Printf () 聽writes the character , string , float, Integer onto the output screen. Scanf () reads the input of the form character or string or numeric data from keyboard.The list also includes the following functions:聽

fopen(),fclose(),gets(),puts(),getc(), getchar()fflush () etc.

Conio.h: console input and output header file,which provides 聽the following library functions:聽

putch () - writes character to console.

getch () - gets character from console.

cprintf () - writes to console.

cscanf () - reads from console.

cgets() - gets string from console.

clrscr () - clears the screen.



Kavya Burramolla
Kavya Burramolla 路 Jan 24, 2020
Rank C1 - EXPERT

We know stdio.h is a standard input output header and conio.h is a console header. Both are the pre processor directives and the main difference comes with the functions used in it and the output it results.

stdio.h header supports the input output operations with library functions like printf(), Scanf(), fopen(), fclose() etc., and the output can be seen either in the output file or the console window.聽

Whereas conio.h header is for console input and output operations. It has functions like cprintf(), cscanf(), getch() etc., that is solely for console window operations.

Karshil Sheth
Karshil Sheth 路 Jan 24, 2020
Rank C2 - EXPERT

stdio.h - Standard input and Output header file. It has definitions of functions like printf() and scanf(). It takes and input from user and displays output either in a file or console.

conio.h - Console input and output. It also does the same as stdio.h but operates only via console. It was used earlier in Turbo C & DOS and has become obsolete now a days.

Teja Reddy
Teja Reddy 路 Feb 25, 2020
Rank C3 - EXPERT

stdio.h - Standard input and Output header file. It has definitions of functions like printf() and scanf(). It takes and input from user and displays output either in a file or console.


conio.h - Console input and output. It also does the same as stdio.h but operates only via console. It was used earlier in Turbo C & DOS and has become obsolete now a days.

You must log-in or sign-up to reply to this post.

Click to Log-In or Sign-Up