What are .h files and what should I put in them?

Answer Posted / deepti

(.h)means a header file,
and all the header files r included using
#include which is a preprocessor directive
i.e #include<stdio.h>
all the data input/output functions r stored in stdio.h
(where std-standard i-input o-output)
for eg.printf,scanf,putchar,getchar,puts,gets..

#include<conio.h>
(where con-console i-input o-output)
for eg.getch(),clrscr()...
there r many header files for diff purposes
like

#include<math.h> for maths

#include<iostream.h> for streams
etc........

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it better to use a macro or a function?

659


stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.

1858


How do you sort filenames in a directory?

719


In a header file whether functions are declared or defined?

633


Which node is more powerful and can handle local information processing or graphics processing?

831






What is the difference between fread and fwrite function?

642


How to compare array with pointer in c?

627


Explain how can I convert a number to a string?

652


What are global variables and how do you declare them?

623


Explain goto?

722


Why is sprintf unsafe?

622


What is the difference between functions abs() and fabs()?

653


Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon

1742


Explain what are reserved words?

639


How do you override a defined macro?

704