Exam 2 Topics
Total Exam Points: 100
- Moodle Portion (Day 1) - 21 Questions
- (48 points) 15 Multiple Choice
- (20 points) 4 Short Answer (Write Output)
- (2 points) 2 True/False
- Coding Portion (Day 2)
Below is a list of all the content that the exam can cover:
Modules
- What files are needed?
- Why/how do we use include guards?
Structures
- How do you define a structure?
- How to use/create an instance of a structure?
- Initialize a structure?
- How do you access structure members?
- Structures and functions
Characters
- How are characters stored?
- Math/logic using characters.
Strings
- What is a string?
- Using strlen()
- Identifing the end of a string.
- What is standard input?
- How do you run a program and supply data to standard input from a file?
- Using scanf() and getchar() to get data from standard input
- EOF
Pointers
- WHAT DO POINTERS HOLD?
- Using pointers as function parameters
- What do the & and * operators do with respect to pointers?
- Using pointers to structures
- How do you access structure members from a pointer (HINT: not the gross way…)?
Call Stack
- What is the call stack?
- What does a stack frame hold?
Command Line Arguments
- Using a main function that accepts command line arguments.
- What is argc and argv?
- Accessing data from argv
- Running a program with command line arguments.
Dynamic Memory Allocation
- Why can’t we return an array from a function?
- What is the Heap?
- What do these functions do?
- malloc()
- calloc()
- realloc()
- free()
- What can cause memory leaks?
- Strategies for dynamic memory allocation.