Lecture 10: October 16, 2019
Reading
:
C text
, §8
Due
: Extra Credit 1: due October 21, 2019; Homework #2, due October 24, 2019
Greetings and felicitations!
When you upload your file to Canvas, it may append a number. That’s fine.
C arrays and strings
String representation: array of chars terminated by NUL (ASCII ‘\0’)
Strings as arguments to functions (
strcpy.c
)
gets(buf)
,
fgets(buf, size, fp)
(
bad.c
,
good.c
)
Example:
ptrstew.
c
C characters
Input
getchar()
and output
putchar()
(
cat1.c
)
Types of characters; include file
ctype.h
(
dasc.c
)
Characters as integers and
vice versa
Printing (
printf.c
)
Matt Bishop
Office: 2209 Watershed Sciences
Phone: +1 (530) 752-8060
Email:
mabishop@ucdavis.edu
ECS 36A, Programming and Problem Solving
Version of October 17 2019 at 10:39AM
You can also obtain a PDF version of this.