Basics #1 Flashcards
(24 cards)
What is a compile-time error?
A compile-time error is an error that occurs during the compilation of the code, preventing the program from being compiled successfully.
True or False: A compile-time error can be detected by the compiler before the program is run.
True
Fill in the blank: A common example of a compile-time error is __________.
syntax error
What is a link-time error?
A link-time error occurs when the linker cannot resolve references between different object files or libraries.
Multiple Choice: Which of the following is NOT a cause of a link-time error? A) Missing library, B) Syntax error, C) Undefined reference
B) Syntax error
True or False: Link-time errors can be fixed by modifying the source code.
False
What is a run-time error?
A run-time error is an error that occurs while the program is executing, causing it to terminate unexpectedly.
Multiple Choice: Which of the following can cause a run-time error? A) Division by zero, B) Incorrect variable declaration, C) Missing semicolon
A) Division by zero
Fill in the blank: Run-time errors are often referred to as __________ errors.
exceptions
What type of error occurs if a variable is used without being initialized?
Run-time error
True or False: Compile-time errors can be fixed at run-time.
False
What type of error would you encounter if you try to access an out-of-bounds index in an array?
Run-time error
Which error type is detected by the linker?
Link-time error
Multiple Choice: Which of the following is a compile-time error? A) Null pointer exception, B) Type mismatch, C) File not found error
B) Type mismatch
Fill in the blank: A __________ error happens when a function is called with an incorrect number of arguments.
link-time
What is the primary difference between compile-time and run-time errors?
Compile-time errors are detected during compilation, while run-time errors occur during program execution.
True or False: A missing library can lead to a link-time error.
True
Which error type is typically easier to debug: compile-time or run-time?
Compile-time error
Fill in the blank: A __________ is an error that occurs when an operation is attempted on an incompatible data type.
compile-time error
What error type would you expect from a stack overflow due to excessive recursion?
Run-time error
Multiple Choice: What type of error is indicated by an ‘undefined reference’ message? A) Compile-time error, B) Link-time error, C) Run-time error
B) Link-time error
True or False: All run-time errors can be caught and handled by exception handling mechanisms.
False
What kind of error is detected when there is a typo in variable name that is not declared?
Compile-time error
Fill in the blank: __________ errors occur during the linking phase of program compilation.
Link-time