lec09

lec09 - File and Network I/O CS 2022: Introduction to C...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: File and Network I/O CS 2022: Introduction to C Instructor: Hussam Abu-Libdeh Cornell University (based on slides by Saikat Guha) Fall 2009, Lecture 9 File and Network I/O CS 2022, Fall 2009, Lecture 9 Input and Output I Keyboard I/O I Disk I/O I Network I/O File and Network I/O CS 2022, Fall 2009, Lecture 9 Streams I In many programming languages, input/output are done in streams I Data exists on the stream, you consume part of it and move on I Examples: I stdout : standard output stream I stderr : standard error output stream I stdin : standard input stream I files I network sockets (network connections) File and Network I/O CS 2022, Fall 2009, Lecture 9 Output to Terminal I Write a line to stdout I puts("hello world"); I Write a formatted line to stdout I printf("Borat says: Hi %s!\n", i); I Can write to streams other than stdout I fputs("an error message", stderr); fprintf(stderr, "Error on value %d\n", i); File and Network I/O CS 2022, Fall 2009, Lecture 9 Input from User (Keyboard)...
View Full Document

This document was uploaded on 03/10/2011.

Page1 / 11

lec09 - File and Network I/O CS 2022: Introduction to C...

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

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