What is the Library?
A library is a collection of pre-written code that we can import in our own program to increase the functionality. Generally, libraries are used so we do not have to write the complete code from the scratch, in C++ we use the header file to import the corresponding library in our program. For instance string is a library of C++ and it contain many built-in functions such as strcpy(), strcmp(), etc. The C++ standard library is categorized into two parts:
- Standard Function Library
- Object-Oriented Library.
Standard Function Library
These libraries contain pre-written functions in a file and mostly all the function libraries of C++ are inherited from the C programming language because C does not support Object-Oriented Programming. Category of Standard Function Library:
- String and character handling,
- Time, date, and localization,
- Dynamic allocation,
- Wide-character functions,
These libraries are the extensive pre-written classes files that provide many functionalities and just by adding the header file in our program we can leverage all the functionalities of the corresponding object-oriented library. Object-Oriented Libraries:
- The Standard C++ I/O Classes
- The String Class
- The Numeric Classes
- The STL Container Classes
- The STL Algorithms
- The STL Function Objects
- The STL Iterators
- The STL Allocators
- The Localization library
- Exception Handling Classes
- Miscellaneous Support Library
- A library is a collection of pre-written code.
- We can use that pre-written code by adding its corresponding header file.
- C++ standard library is categorized into two categories function library and Object-Oriented Library.
- All the Functions libraries of C++ are inherited from the C programming language.
People are also reading: