File Opening Modes in C Language


O LEVEL -PAPER 3rD -- M3-R4

C  LANGUAGE 




FILE OPENING MODES IN  C :--



fopen in c,file opening mode in c
file opening modes

                                                                        

READING FROM A FILE MEANS :-


Extracting data from a file to our program variables.

This will not remove data from the file.


HOW TO START PROGRAM ?


fopen in c, reading file in c
fopen in c



Here in above example we take file pointer *fp and mode 'r' .



HOW TO CHECK IF FILE IS OPENED ?




Here in above example we take if condition to check file is open or not and pass (fp==null) as a condition and use 'exit' to terminate the program if file is not found.

EXAMPLE :-


WRITE A PROGRAM TO READ CONTENT FROM A  FILE AND DISPLAY ON THE SCREEN.


fopen in c,fclose in c
example reading from a file

Here in above example we used feof(), this function is used for returning true or false 
(0and1)value. and used fgetc() function to read the character of a program .

I F THIS ARTICLE IS HELPFUL TO YOU THEN PLEASE LIKE AND SHARE..THANK YOU..

Comments

Popular posts from this blog

Notepad, Wordpad and Paint

HOW TO PASS CCC EXAM WITH ONE ATTEMPT (NIELIT)

Inheritance in C++ Language(part 1)