Outline for April 12, 2002
Handouts: More Sample C Programs
Reading: Johnsonbaugh & Kalin pp. 230-237, 305-329
-
Greetings and felicitations!
-
Homework 2 to be handed out on Monday, will be due on April 29
-
copy1.c
-
strings (NUL-terminated arrays)
-
printing strings
-
copy2.c
-
definition of pointer; address of variables (&), dereferencing of pointer (*)
-
how it is used
-
pointer arithmetic (in the printf)
-
swaps.c
-
pointers and parameter lists
-
pointers and var paramaters
-
paa.c
-
str1copy: condition on for, explicit comparison
-
str1copy: condition on for, implicit comparison
-
str3cpy: condition on for, implicit comparison from assignment
-
str4cpy: pure pointers
-
fileio.c
-
like program 5 from first handout, but driven by files not standard input
-
show technique for developing this (program becomes function, add file I/O driver)
-
go through file manipulation functions