Lecture28-LIN-11062019-File2.pdf - Computing I COMP.1010 Fall 2019 Lecture 29 File in C(II By Sirong Lin PhD University of Massachusetts Lowell Upcoming

Lecture28-LIN-11062019-File2.pdf - Computing I COMP.1010...

This preview shows page 1 - 8 out of 25 pages.

By: Sirong Lin, PhD Computing I University of Massachusetts Lowell COMP.1010, Fall 2019 Lecture 29: File in C (II)
Image of page 1
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin Upcoming Due Dates 2 Due Date Daily 21 11-06-2019 (W), 9:00pm Week 10 Reading MWF, 9:00am Week 10 Practice Sun, 9:00pm Daily 22 11-08-2019 (F), 9:00pm HW4 11-08-2019 (F), in class fscanf HW 11-08-2019 (F), BEFORE class
Image of page 2
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin Announcement Today’s Office Hours: 1:55pm - 2:45pm 3
Image of page 3
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin File Introduction open and close a file in C read from a file (Cont’d) write to a file stdin, stdout more file functions 4
Image of page 4
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin File Review Standard input/output FILE is an opaque data type — a structure that contains many information about a file need to use FILE pointer (handle) to access of a file can’t use deference operator with the file pointer variable EOF (-1) represents the end of file (fscanf function return value ) 5
Image of page 5
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin File — file position marker When a file is opened, a file position marker is set to some location in the file and indicates the next place in the file to read or write data 6
Image of page 6
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin File — file position marker (Cont’d) when a file is opened in mode “r” or “w”, the marker is set to the beginning of the file; when a file is opened in mode “a”, the
Image of page 7
Image of page 8

You've reached the end of your free preview.

Want to read all 25 pages?

  • Fall '15

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes