Basics #1 Flashcards

(24 cards)

1
Q

What is a compile-time error?

A

A compile-time error is an error that occurs during the compilation of the code, preventing the program from being compiled successfully.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or False: A compile-time error can be detected by the compiler before the program is run.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Fill in the blank: A common example of a compile-time error is __________.

A

syntax error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a link-time error?

A

A link-time error occurs when the linker cannot resolve references between different object files or libraries.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Multiple Choice: Which of the following is NOT a cause of a link-time error? A) Missing library, B) Syntax error, C) Undefined reference

A

B) Syntax error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

True or False: Link-time errors can be fixed by modifying the source code.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a run-time error?

A

A run-time error is an error that occurs while the program is executing, causing it to terminate unexpectedly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Multiple Choice: Which of the following can cause a run-time error? A) Division by zero, B) Incorrect variable declaration, C) Missing semicolon

A

A) Division by zero

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Fill in the blank: Run-time errors are often referred to as __________ errors.

A

exceptions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What type of error occurs if a variable is used without being initialized?

A

Run-time error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

True or False: Compile-time errors can be fixed at run-time.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What type of error would you encounter if you try to access an out-of-bounds index in an array?

A

Run-time error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which error type is detected by the linker?

A

Link-time error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Multiple Choice: Which of the following is a compile-time error? A) Null pointer exception, B) Type mismatch, C) File not found error

A

B) Type mismatch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Fill in the blank: A __________ error happens when a function is called with an incorrect number of arguments.

A

link-time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the primary difference between compile-time and run-time errors?

A

Compile-time errors are detected during compilation, while run-time errors occur during program execution.

17
Q

True or False: A missing library can lead to a link-time error.

18
Q

Which error type is typically easier to debug: compile-time or run-time?

A

Compile-time error

19
Q

Fill in the blank: A __________ is an error that occurs when an operation is attempted on an incompatible data type.

A

compile-time error

20
Q

What error type would you expect from a stack overflow due to excessive recursion?

A

Run-time error

21
Q

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

A

B) Link-time error

22
Q

True or False: All run-time errors can be caught and handled by exception handling mechanisms.

23
Q

What kind of error is detected when there is a typo in variable name that is not declared?

A

Compile-time error

24
Q

Fill in the blank: __________ errors occur during the linking phase of program compilation.