Join 75,000+ students acing their exams with Studygenie
Unlimited practice
Flashcards, multiple choice and written questions, as many as you want.
Study sets in seconds
Turn your notes and files into a set with AI.
See your progress
Always know what you've learned and what's left.
Questions in this set (8)
What are the advantages of using typedef?
makes program more understandable, easier to modify
What is the goal of modular design?
makes program into smaller and easier to understand components, reusable structs and concepts, ability for multiple people to work together
How is program dived into?
- abstraction
- reusability
- maintainability
What are the 2 main parts of modular design?
1. interface
2. implementation
When debugging, what can you do?
use assert
add printf throughout the code and see where it stops
or do source level debugging
What's wrong with using printf when debugging? What can we do to solve it?
printf is buffered, our OS doesn't immediately print after calling it. Use fflush to force OS to print it.
Tell me about source-level debuggers
1. observe flow by stepping through your program 1 by 1
2. observe state by watching variables as they change
3. add breakpoints to stop execution at certain points
What is the strategy for debugging?
1. run program with no breakpoints
2. observe the flow of the program by inspecting stack trace after code crash
3. add breakpoint near crash
4. restart program then step through each line (observe state)