Difference between Standard I/O Library and ANSI in C

Question: What are Differences Between Standard I/O Library and ANSI Library of I/O Functions

Answer: Actually, concept of library of functions came into existence with K and R C implementation. Though K & R C had very little in the way of library of functions to support input and output. Programmers who wanted sophisticated I/O functionality than that provided had to implement their own.

This situation was greatly improved in Standard I/O library, a collection of functions which implemented much of added functionality which the programmer had been implementing on their own. This library expanded on the existing functions, for ex. printf(), creating new functions which could be used in a variety of situations. Further, standard library introduced the concept of Buffered I/O which enhances the efficiency of most programs.

But standard library of I/O functions had two significant drawbacks, first, it’s implemented on one particular machine without giving much thought to other machines with different architectural features. And second was directly related to first. As soon as first drawback discovered, programmers’ attempted to fix that by modifying the library functions. And as soon as they did so, though, functions were no longer standard thereby reducing portability.

ANSI C implementations evolved through long diligence over the existing standard I/O library. Functions in ANSI C implementations were direct descendants from standard I/O library. Portability and completeness were key considerations in the design of ANSI library. Most of the differences between ANSI implementation and their counterparts are the additions that enhance the portability or functionality. However, a continuous diligence might improve them further but they will not modifying already existing functions. Instead, they will be implemented as separate functions in the library. Thus portability doesn’t suffer.

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.