Question 66
Variables defined outside all functions at file/program scope are generally called -
Variables defined outside functions have global/file scope. In C, visibility across different source files requires an appropriate extern declaration.
Variables defined outside all functions at file/program scope are generally called -
Variables defined outside functions have global/file scope. In C, visibility across different source files requires an appropriate extern declaration.
Which loop control structure is best suited when the exact number of iterations is known prior to loop execution?
A 'for' loop consolidates initialization, condition testing, and iteration counter update in a single readable header line.
In C++, what keyword suggests to the compiler to substitute function body inline at the point of call to eliminate function call overhead?
The 'inline' keyword hints compiler to insert function code directly at call sites, reducing call stack overhead for small functions.
What happens when the condition of a while loop never evaluates to False (e.g., while(1) or while True)?
A loop whose condition remains perpetually True runs continuously as an infinite loop unless explicitly broken via break or return.
How can recursion be replaced or converted in program execution to conserve call stack memory?
Converting recursive logic into iterative loops eliminates call stack frame overhead and prevents stack overflow errors.