C - Basics and Execution EnvironmentWhy does the linker sometimes produce an 'undefined reference' error during the C compilation process?ABecause a function or variable is declared but not defined in any object fileBBecause the preprocessor failed to include header filesCBecause the assembler generated incorrect machine codeDBecause the source code has syntax errorsCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand linker's roleThe linker combines object files and resolves references to functions and variables.Step 2: Cause of 'undefined reference'If a function or variable is declared but missing definition in any object file, linker errors occur.Final Answer:Function or variable declared but not defined -> Option AQuick Check:Undefined reference = missing definition at link time [OK]Quick Trick: Undefined reference means missing function or variable definition [OK]Common Mistakes:Blaming preprocessor for linker errorsConfusing syntax errors with linker errorsAssuming assembler causes undefined references
Master "Basics and Execution Environment" in C9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More C Quizzes Conditional Statements - Switch vs if comparison - Quiz 11easy Conditional Statements - If–else statement - Quiz 2easy Conditional Statements - If–else statement - Quiz 9hard Conditional Statements - Nested conditional statements - Quiz 13medium Input and Output - Format specifiers - Quiz 9hard Loop Control Statements - Why loop control is required - Quiz 8hard Loops - Why loops are needed - Quiz 8hard Loops - Loop execution flow - Quiz 3easy Loops - Do–while loop - Quiz 11easy Variables and Data Types - Type modifiers - Quiz 9hard