Your SlideShare is downloading. ×
0
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
docu...
Typing Speed: 20

Muhammed shafi
shafi3949@gmail.com
Shafi breeze
Shafi breeze
in.linkedin.com/in/profilena
me
9961073949
TOPIC

File operations in C
File operations
We frequently use files for storing information
which can be processed by our programs. In
order to store ...
• In C we use FILE * to represent a pointer to a
file.
• fopen is used to open a file. It returns the
special
• value NULL...
Modes for opening files
The second argument of fopen is the mode in
which we open the file. There are three
• "r" opens a ...
Writing to a file using fprintf( )
fprintf( ) works just like printf and sprintf
except that its first argument is a file ...
Reading Data Using fscanf( )
We also read data from a file using fscanf( ).
Closing a file
We can close a file simply using fclose( ) and
the file pointer.
Example of File operations
THE END
Create by Shafi
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550

Start up Vil...
File oparation in c
Upcoming SlideShare
Loading in...5
×

File oparation in c

628

Published on

File oparation in c

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
628
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "File oparation in c"

  1. 1. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  2. 2. Typing Speed: 20 Muhammed shafi shafi3949@gmail.com Shafi breeze Shafi breeze in.linkedin.com/in/profilena me 9961073949
  3. 3. TOPIC File operations in C
  4. 4. File operations We frequently use files for storing information which can be processed by our programs. In order to store information permanently and retrieve it we need to use files. Files are not only used for data. Our program are also stored in files.
  5. 5. • In C we use FILE * to represent a pointer to a file. • fopen is used to open a file. It returns the special • value NULL to indicate that it couldn't open the file.
  6. 6. Modes for opening files The second argument of fopen is the mode in which we open the file. There are three • "r" opens a file for reading • "w" creates a file for writing - and writes over all previous contents (deletes the file so be careful!) • "a" opens a file for appending - writing on the end of the file • “rb” read binary file (raw bytes) • “wb” write binary fil
  7. 7. Writing to a file using fprintf( ) fprintf( ) works just like printf and sprintf except that its first argument is a file pointer.
  8. 8. Reading Data Using fscanf( ) We also read data from a file using fscanf( ).
  9. 9. Closing a file We can close a file simply using fclose( ) and the file pointer.
  10. 10. Example of File operations
  11. 11. THE END Create by Shafi
  12. 12. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×