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.
- Check Computer Science Books
- Watch Advanced C Programming Videos
- Check C Books
- Apply for C Internship
- Apply for Computer Science Internship