2.5 LIBRARY FUNCTIONS

From our school days, we are familiar with functions like sin(x). Rather than forcing us to write code, for them, the language designers provide such common functions that are termed as library functions. For convenience, they are organized in various header files. The header files have conventionally “.h” extension. Table 2.9 lists useful header files and most common functions there in.

 

Table 2.9 Selected Header Files

Header file Important functions
math.h sin, cos, log, floor, ceil
stdio.h scanf, printf, gets, puts, getchar, putchar
stdlib.h calloc, malloc, rand, srand
string.h strcpy, strlen, strcmp

A detailed list of all the header files supported by C++ with useful functions is described in section “Appendix”. ...

Get Object Oriented Programming with C++, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.