- 1
What is use of #, include, <math.h> , <conio.h> , <stdio.h> ?
5 Réponses
+ 5
its the way of telling the compiler that it is a pre processor directive. which means before the beginning of compilation, those with # will be executed first.
+ 3
those are called as header files.
those contain some predefined functions in them so that we can make use of them.
for example
math.h contains mathematical functions like sqrt() pow() etc.
stdio.h contains basic input output functions like printf scanf,
so if you are using them in your code, you must include the header files.
+ 1
# is an indicator for the computer to expect the type of program below and prepare first by importing only needed definition libraries instead of loading the entire library. code efficiency is drastically improved. stdio means standard input output. math.h is a header that allows you to use mathematical expressions.
0
what is # then??
0
#include is a preprocessor directive.
The standard predefined functions which we use directly such as sqrt(),sin(),getchar() or objects like cin and cout are declared and their behaviour is predefined in some classes. Header files contain these classes. Thus in order to use these functions we need to include the respective header file. All header files have an extension .h . Below are some header files:
stdio.h - std I/p o/p related eg. :gets()
conio.h - console I/p o/p related eg: clrscr()
string.h - all string manipulation functions eg: strlen()
iomanip.h - manipulation of I/p o/p formatting eg. setw()
and many more....