Posts

Showing posts from June, 2017

C PROGRAMS

Image
ADDITION OF MATRIX ARRAY OF STRUCTURE ARRAY ASCENDING AUTO AVG BIN BIGGEST NUMBER OF   ARRAY BINARY TREE BUBBLE CALCULATE SIMPLE INTEREST HELLO WORLD CMDLINE COMPARE COMPARE1 COMPLIMENT TO BINARY COPING FILE DISPLAY ON CONSOLE DLL DO WITH SWITCH DTB EIGHT ENUM STRUCTURE EXTERN FACT FACT1 FACTORIAL FAHRENHEIT FIB FIB1 FILE CONTENT FILE EXIST FIOF FIVE FOR LOOP FOR FOUR FUN1 FUNPTR GOTO GRAPH HELLO LINE MACRO MATADD MATRIX MENU DRIVEN NESTED STRUCTURE NINE NUMPALI ONE PALISTR PERFECT POINT12 PRIFUN1 PRIME QUAD QUEUE READ RECORD & WRITE AS BINARY READING RECORDS READING STRING REGISTER ROOTS...

ERROR  HANDLING  DURING I/O OPERATIONS

ERROR   HANDLING   DURING I/O OPERATIONS It is possible that an error may occur during I/O operations on a file. Typical error situations include: 1. Trying to read beyond the end-of-file mark. 2. Device overflow. 3. Trying to use a file that has not been opened. 4. Trying to perform an operation on a file, when the file is opened for another type of operation. 5. Opening a file with an invalid filename. 6. Attempting to write to a write-protected file. RANDOM ACCESS TO FILES We have discussed file functions that are useful for reading and writing data sequentially. There are occations, however, when we are interested in accessing only a particular part of a file and not in reading the other parts. This can be achieved with the help of the functions fseek , ftell , and rewind available in the I/O library, ftell takes a file pointer and returns a number of type long, that corresponds to the current position. This function is useful in saving thecurrent po...

FILE MANAGEMENT IN C

FILE MANAGEMENT IN C: INTRODUCTION: A file is a place on the disk where a group of related data is stored. C supports a number of functions that have the ability to perform basic file operations, which include: 1.    naming a file, 2.      opening a file 3.     reading data from a file 4.     writing data to a file 5.       closing a file The C library uses the following High Level I/O functions: Function name                                Operation fopen()                                          Creates a new file for use     ...