Intro
C: Study Guide
This
guide does not include topic
detail
Chapters 6, 7, most of 8
Builtin
character-processing Boolean functions
isalpha
isupper
islower
isdigit
ispunct
isspace
Builtin
character conversion functions
toupper
tolower
Return value of each must be captured or somehow used
Data
validation
f/scanf()
return value of EOF or number of successful conversions
Character
processing
EOF
getchar(),
putchar()
while ((cInput = getchar())
!= EOF)
Iteration
while
for
do-while
nested loops
jump statements
break: only acceptable in switch
statement
continue: not acceptable
return: only acceptable once
sequentially at end of function
goto:
not acceptable
Files
file streams
fopen(),
fclose()
fprintf(), fscanf()
fgetc(), fputc()
FILE *, NULL
stdin, stdout, stderr
Recursion
why to use in place of iteration
infinite recursion
base case(s)
recursive case(s)
requirements for writing recursive function
control parameter
base case(s), recursive case(s)
return value if calculating
factorial,
fibonacci,
implied base case
homogeneous collection of data stored contiguously in memory and indexible
by same name and
subscript
1D, 2D, multiD
scalar variable
indices 0 to n-1 for size n
array name is address
use #define for array size references for ease of maintenance
declaration, initialization, accessing elements
[] index operator
process with for loop
boundaries are programmer's responsibility
passing arrays to functions (PBR), passing 1 row of 2D (PBR), passing 1
element
(PBV)
why is it necessary to specify column size when passing 2D array to
function
data type and actual memory address of row or element given starting
address,
array declaration, and subscripts
Sorting
Bubble
Selection
Insertion
Show order of elements after some number of passes over the data