Bird
0
0

Given these commands:

medium📝 Predict Output Q5 of 15
C - Basics and Execution Environment
Given these commands:
gcc -c main.c
gcc -c utils.c
gcc main.o utils.o -o app

What is the role of the last command?
ACompile source files into object files
BPreprocess source files
CLink object files into an executable
DAssemble assembly code into object files
Step-by-Step Solution
Solution:
  1. Step 1: Understand previous commands

    First two commands compile source files to object files (main.o, utils.o).
  2. Step 2: Analyze last command

    Last command links object files into executable named 'app'.
  3. Final Answer:

    Link object files into an executable -> Option C
  4. Quick Check:

    Linking = combining object files to executable [OK]
Quick Trick: Link object files with gcc without '-c' [OK]
Common Mistakes:
  • Thinking last command compiles source
  • Confusing linking with preprocessing
  • Assuming assembling happens in last command

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes