How to Get a Linux Function

How to Get a Linux Function thumbnail
The GNU standard libraries contain many indispensible functions.

Functions are an integral part of C and C++ programming, allowing you to perform complex tasks with only a few lines of code. Many useful functions are included in the GNU standard libraries that come with every Linux distribution, but finding the one you want can be difficult, especially if you're not used to reading through header file code. Getting and using Linux functions is made much easier with the standard library documentation.

Instructions

    • 1

      Install your distribution's glibc-doc package. In Ubuntu, this is done by clicking on the Ubuntu Software Center icon on the launcher, entering the package name in the search bar, selecting the package and clicking "Install." Other Linux distributions have other processes; consult your documentation if unsure how to install.

    • 2

      Open "/usr/share/doc/glibc-doc/html/index.html" in your Web browser. This will display the table of contents for the GNU C Library documentation. Browse through it until you find a page whose title resembles the function you're looking for and click on it. Read the function's documentation.

    • 3

      Include the header file containing the function you wish to use at the beginning of your C or C++ code with the #include preprocessor command, placing the header file name between brackets. Use the function as desired in the body of your code.

Tips & Warnings

  • The GNU C library documentation also is available on the GNU website (see Resources for link).

Related Searches:

References

Resources

  • Photo Credit Thinkstock Images/Comstock/Getty Images

Comments

Related Ads

Featured