What is Standard Library in C?

Question: What is Standard Library and How this Empowers a C Programmer

Answer: Programming in C requires any C program to use various different functions for different requirements to be best taken care of. For ex. to copy a string ‘strcpy()’ library function, for printing formatted data to stdout, ‘printf()’ is used. There are several dozens of functions which facilitate every C programmer in writing programs for different requirements. All these functions are put together in the standard library. Though, functions performing somewhat similar tasks are put together in same header file. For ex. functions performing input and output are put together in ‘stdio.h’ header, those performing string manipulations are defined in ‘string.h’ header.

You can view header files for Standard Library on your machine (Linux) by executing following command

    cd /usr/include; vi stdio.h; /* There are many header files in this directory */
    ls -l /lib/libc* / * this will show libc the shared library */

ANSI C standard defines library of functions included in specification. Each ANSI implementation will have mandated set of functions, and they will have the required interface and that they work in prescribed manner. This makes writing portable programs with ease. Since library defines functions for almost every requirement, this empowers a C programmer in writing efficient and portable programs.

Sanfoundry Global Education & Learning Series – 1000 C Tutorials.

If you wish to look at all C Tutorials, go to C Tutorials.

If you find any mistake above, kindly email to [email protected]

Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.