Library Functions
A library function is a function that can be called by a program to perform some task, but it is not part of the program itself. Typically library functions are collected together into libraries, which comprise suites of functions that are loosely related in some way. An example might be a collection of functions that deal with dates and times and how they can be formatted or represented. Libraries save programmers the bother of writing code to do the same tasks time and time again; in short, libraries encourage code reuse.
The code the library comprises is usually in the form of "machine code" that the computer can understand rather than human-readable source code, although this is not always the case, especially with "open source" libraries like those from the GNU project.
There are two main types of libraries: static libraries that are read by the compiler at compile-time and bound into the final version of the executable code; and dynamic libraries that are referred to by name to the compiler but the code is not actually incorporated into the executable until the program is run. One advantage of dynamic libraries is that they can be updated without having to update the program that calls them.
When programmers want to use a function from a library they call it by name and make sure that the compiler or the run-time environment can see the pre-compiled code or "library file." In C and C++ the programmers also need a "header file" that describes how the library functions should be called so the compiler can carry out its type-checking as it compiles the program. Most compilers also support options or "switches" to allow programmers to create their own libraries from their own code.
Function libraries extend the native language they are written in by providing easily accessible commonly used functionality that the language itself does not directly support. A good example is the C programming language. C by itself has very little functionality other than the raw operators the language supports; however, some functions are so useful and needed so often that they have been packaged into libraries and now form part of the standard distribution of the language. That is, ANSI C comes with "standard libraries" for manipulating character strings and for performing input from the keyboard and output to the monitor, even though these things are not part of the strict definition of the language.
Currently nearly all computer-programming languages have a vast array of libraries, both free and commercial packages, that are available to carry out almost every conceivable function--from manipulating socket connections between computers to performing complex and military-grade cryptographic transformations.
This is the complete article, containing 439 words
(approx. 1 page at 300 words per page).