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.
- Get Free Certificate of Merit in C Programming
- Participate in C Programming Certification Contest
- Become a Top Ranker in C Programming
- Take C Programming Tests
- Chapterwise Practice Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Chapterwise Mock Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Buy Computer Science Books
- Buy C Books
- Practice Computer Science MCQs
- Apply for C Internship
- Watch Advanced C Programming Videos