Loading....
Coupon Accepted Successfully!

 

Header Files

  • Any function prototypes and type definitions that can be exported from a source code directory are kept in a header file.
  • From the point the main application, these functions are external.
  • The compiler reads the included header files and tells the particular functions that come from.
  • Let us learn about the header files in detail.
  • They are of many types, namely
    • stdio.h
    • string.h
    • math.h
    • stdlib.h
    • iostream.h

stdio.h function

  • The input and output operations can also be performed using C++.
  • To perform this operation the standard input and output library is imported.
  • They are stored in a stream of data to operate with physical devices such as keyboard, printer, and terminals or with any other type of files supported to the system.
  • It contains the following functions.

Operations on files

  1. remove
  2. rename
  3. tmpfile
  4. tmpname
File access
  1. fclose
  2. fflush
  3. fopen
  4. freopen
  5. setbuf
  6. setvbuf
Formatted input / output
  1. fprintf
  2. fscanf
  3. printf
  4. scanf
  5. sprintf
  6. sscanf
  7. vfprintf
Direct input/output
  1. fread
  2. fwrite
Error handling funtion
  1. learerr
  2. feof
  3. ferror
  4. perror

String.h

  • This header file contains several string manipulation and memory manipulation routines.
  • They are as follows
    1. memccpy
    2. memicmp
    3. movemem
    4. strcmp
    5. strdup
    6. strlen
    7. strncmpi
    8. strspm
    9. strxfrm
    10. memchr
    11. memmove
    12. stpcp
    13. strcoll
    14. strcpy
    15. stricmp
    16. strmcat

math.h function

  • These headers files are used to declare the prototypes for the math functions and math error handlers
  • The following are the math function directives.
    • acos
    • acos1
    • asin
    • asin1
    • atan
    • atan1
    • atof
    • cabs
    • cabsl
    • ceil
    • ceill
    • cos
    • cosl
    • cosh
    • cosh1
    • div
    • exp
    • expl
    • fabs
    • fevt
    • floor floor1

stdlib.h Function

  • It is a header file of the general purpose standard library of C++ language.
  • It includes functions involving memory allocation, process control, conversion and others.
  • It contains the following functions
    • _fullpath
    • _makepath
    • _searchenv
    • _splitpath
    • atof
    • atoi
    • atol
    • ecvt
    • fcvt
    • gcvt
    • itoa
    • ltoa
    • labs
    • malloc
    • realloc

iostream.h function

  • This header file declares the basic C++ streams I/O routines.
  • Some of the function are given below
    • open
    • close
    • get
    • getline
    • read
    • write
    • put
    • seekg
    • seekp
    • tellg
    • tellp
    • ignore
    • peek
    • putback
    • flush
    • restate
    • bad
    • eof
    • fail
    • good
    • clear
Note: the header file iostream can be declared as iostream.h or iostream. Both the values are accepted by the compiler.




Test Your Skills Now!
Take a Quiz now
Reviewer Name