lecture19-mar5 - Announcements Lecture 19 Assignment 4...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Announcements Lecture 19 • Assignment 4 – Designs due today in recitation; – Q&A • Topics for today (Read Ch. 16 , and then 14-15 for next week) – Finish file IO – More on pointers – Stacks and The system stack File IO Reminders from Last Time Formatted file IO functions int fprintf (FILE *fp, “format-string” , list-of-values ); – returns # characters written, - if error occurs int fscanf (FILE *fp, “format-string” , list-of-variables ); – returns # input items read, EOF if error Binary IO functions – operate on blocks of binary data size_t fread (void * ptr , size_t size , size_t num , FILE * fp ); returns # elements read, < num if error or end of file size_t fwrite (void * ptr , size_t size , size_t num , FILE * fp ); – returns the # of elements written, < num if error Random access functions – lets you process a file non- sequentially int fseek (FILE *fp, long int offset, int fromWhere); – returns 0 if successful, !0 otherwise long int ftell (FILE *fp); returns the current file position indicator, -1 if error Example /* a program to write 10 double values out to disk file - ask user which one they want
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/15/2010 for the course EE 16005 taught by Professor Krasner during the Spring '10 term at University of Texas at Austin.

Page1 / 2

lecture19-mar5 - Announcements Lecture 19 Assignment 4...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online