File Handling Functions in C

Question: Which I/O Functions or Family of Functions deal with Individual Characters, Text Lines and Binary Data in C Language Answer: ANSI C standard provides specific family or set of functions to perform I/O on different types of data. For Character I/O, getchar and putchar family of functions, for text data I/O we have gets … Read more

advertisement

Explain the Type of I/O Operations Supported by the C Library

This C Tutorial explains various type of I/O operations which are supported by standard C Library. There are three basic forms of data which I/O functions deal with. These are 1. Individual characters 2. Textual data or Text lines 3. Binary data Different set of I/O functions process each different type of data. Different members … Read more

advertisement

Difference between I/O on Standard Streams and Files in C

Question: What is Basic Difference Between I/O on Standard Streams and I/O on Files in C Program? Answer: Every runtime environment must provide three streams viz. standard input, standard output and standard error to every C program. These streams are stdin, stdout and stderr and these are pointers to FILE structure. stdin is default to … Read more

advertisement

EOF, FOPEN_MAX and FILENAME_MAX Constants in C

Question: What are EOF, FOPEN_MAX and FILENAME_MAX Constants for and How Can we Use them in a C Program? Answer: Each file how long it may be but ends. EOF character marks end of it. Many of I/O functions return EOF when they have reached end of the given file. The value chosen for EOF … Read more

advertisement

Text and Binary Streams in C

Question: What are Text and Binary Streams in C? Answer: There are two types of streams in C: Text streams and Binary streams. Text streams may have certain characteristics that may vary from system to system. One of these is maximum length of text line. Though standard defines it to be at least 254 characters … Read more

advertisement

What is Stream in C Programming?

Question: What is Notion of Stream in C Programming? Answer: We perform writing to and reading from some of the common devices, viz. floppy drives, CD-ROM drives, hard drives, network communication etc. Each of these devices have different characteristics and operating protocols. It’s the operating system that takes care of details of communication with these … Read more

advertisement

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 … Read more

advertisement

exit() Function in C with Example

This tutorial explains the exit() function in C and how it is used. The exit() function is useful to terminate a program after detecting an error that prevents the program from continuing to run normally. The prototype is as follows: void exit(int status); Status argument passed to exit() is returned to O.S. to inform that … Read more

advertisement

perror() Function in C with Example

Question: Why perror() Function is Used in a C Program? Answer: Generally, we write programs to perform specific operations, for ex. opening a file for reading. Such operations are accomplished by using standard library functions. These functions in turn request O.S. to perform the requested operation. Then there’s chance that O.S. might fail for ex. … Read more

advertisement

What is ANSI C Implementation?

Question: What is ANSI C Implementation? Answer: In early days of C, different implementations in order to enhance the performance of the program, improved the common library functions by modifying or extending their functionality. These changes nay have been useful for particular implementations for which they were made, but they inhibited portability because the code … Read more

advertisement
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.