🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Storage Classes in C: all 15 questions

Quiz: Storage Classes in C · Question 2 of 15

What is the difference between scope and lifetime?

What is the difference between scope and lifetime?

  1. A.They are two names for the same thing
  2. B.Scope is about memory; lifetime is about the name
  3. C.Scope is where the name can be used; lifetime is how long the memory exists
  4. D.Scope applies only to globals; lifetime only to locals
Answer & explanation

Correct answer: Scope is where the name can be used; lifetime is how long the memory exists

A static local shows the difference: its name works only inside the function, but its memory lives for the whole program.

Can you get the rest right without peeking?

Take the timed Quiz: Storage Classes in C quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →