Quiz 5 Review

Read Chapters 8 & 10.

Review Exercises at the end of Chapters 8 and 10.
Review the Class Notes for Functions, Global & Static Variables, and Strings.

Quiz 5 will contain some more material from Variables/Parameters notes including scope/visibility and lifetime. This also includes background knowledge of Functions.

Global & Static Variables

Identify which parts of a program are:

Global Variables
External Static Variables
Internal Static Variables
Local Variables
(Formal) Parameters
Function Definitions
Function Declarations (Function Prototypes)

Specify the Scope/Visibility and Lifetime of each of the above.

Identify the 5 areas of the C Runtime Environment and what parts of a C program are mapped to each of these areas (Text/Data/BSS/Heap/Stack).


Strings as array of char
'\0' null terminating char. as a sentinel marking the end of the string
Printing strings with printf() and %s format specifier
Finding the length of a string with strlen()
Difference between strlen() and sizeof()
Arrays of chars and pointer to char similarities and differences
char string[] vs. char *ptr
Copying strings with strcpy()/strncpy()
Concatenating/appending strings with strcat()/strncat()
Comparing strings with strcmp()/strncmp()
Character input with scanf() and %c format specifier
Character input with getchar()
String (really word) input with scanf() and %s format specifier
Reading from a string with sscanf()
String (really line) input with gets()/fgets()
Difference between gets() and fgets() in handling of newline char
The empty string
Escape characters
ctype.h character checking and conversions [ is* and to* ]
Character digit -> integer and integer -> character digit conversions with '0'

What question would you most like to see on the Final Exam?