You write [HASHTAG]#include[/HASHTAG]<stdio.h> and [HASHTAG]#include[/HASHTAG]<conio.h> 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.Akhil VijayCan anyone please let me know the difference between stdio.h & conio.h and where & when these header files should be used?
<stdio.h> contain some functions prototypes like printf(), scanf(), cout,cin.
<conio.h> 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?PROSENJITYou write [HASHTAG]#include[/HASHTAG]<stdio.h> and [HASHTAG]#include[/HASHTAG]<conio.h> 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.
<stdio.h> contain some functions prototypes like printf(), scanf(), cout,cin.
<conio.h> 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. 😀
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 VijayCan anyone please let me know the difference between stdio.h & conio.h and where & when these header files should be used?
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.Akhil VijayThank you very much. Is it necessary to use both the header files in every program that we do?
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]<stdio.h>
[HASHTAG]#include[/HASHTAG]<conio.h>
// rest of the program
The proper way to do this would be:
[HASHTAG]#include[/HASHTAG]<stdio>
using namespace std;
// rest of the program.
I hope this would be a good pointer for you.
Sanyam KhuranaSTDIO 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]<stdio.h>
[HASHTAG]#include[/HASHTAG]<conio.h>
// rest of the program
The proper way to do this would be:
[HASHTAG]#include[/HASHTAG]<stdio>
using namespace std;
// rest of the program.
I hope this would be a good pointer for you.
Thank you very much for the info.Sanyam KhuranaSTDIO 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]<stdio.h>
[HASHTAG]#include[/HASHTAG]<conio.h>
// rest of the program
The proper way to do this would be:
[HASHTAG]#include[/HASHTAG]<stdio>
using namespace std;
// rest of the program.
I hope this would be a good pointer for you.
Could you please shed some light on the difference between Standard Input Output and Console Input Output?Sanyam KhuranaSTDIO 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.
Just give the striking difference between them. Technical details are not required as of now.
Are header files really a part of compiler?PROSENJITTo 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
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...
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().
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)
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.
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.
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.
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.
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.
Both studio.h and conio.h are header files, studio.h stands for standard input and output header file, it's allows the program to hold scanf() & printf() in C language and cin & cout in C++ language whereas coion.h stands for console input and output and allows the clrscr() and getch() this header file is common used in old microprocessor with 8086 and C compiler with 16-bit.
Related Posts
@Ankita Katdare · Jun 7, 2015
@Jerome Infante · Sep 12, 2015
@Ankita Katdare · Mar 3, 2014
@Kaustubh Katdare · Apr 19, 2015
@Kaustubh Katdare · Feb 16, 2011