Lecture 27 Outline (November 30, 2015)
Reading
:
text
, §11
Greetings and felicitations!
Midterms are in my office; you can come get them there.
Homework 5 is last homework
I will schedule a review session on December 7 or 8, depending on when I can get a room
Reading, writing text data with a fixed format
Reading in text data with a fixed format (
fscanf
,
scanf
)
Outputting text data with a fixed format (
fprintf
,
printf
)
Reading, writing characters and lines
Reading text data as lines (
fgets
,
gets
— do not use this!)
Reading text data as characters (
fgetc
,
getc
,
getchar
,
ungetc
)
Writing text data as lines (
fputs
,
puts
— latter adds a trailing newline)
Writing text data as characters (
fputc
,
putc
,
putchar
)
Other useful stuff
Test for end of file (
feof
, also
EOF
or
NULL
)
Conditional operator
condition
?
if_true
:
if_false
Macros
Without arguments
With arguments
You can also obtain a PDF version of this.
Version of November 30, 2015 at 6:43AM