Multiple choice

Which of the following variables are called global variables in C++?

  1. Static variables

  2. Register variables

  3. Extern variables

  4. Auto variables

  5. None of these

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Extern variables can be used to access in a file which is declared and defined in some other files, so these have a global scope outside the particular class and hence, they are called global variables.