You are on page 1of 2

NAME:

Adeyemo Aramide David

MATRIC. NO.:
19CJO25764

PROGRAMME:
Computer Engineering

COURSE:
GEC 225

1. What does scope refer to?


Scope refers to the to the portion of the program over which the variable is
recognized.

2. What are the scope levels in C?


There are three scope levels in C; Statement, Global and Function scope level.

3. Why is it usually a good thing to avoid using the global storage class?
Using global variables causes very tight coupling of code, it causes name space
pollution. This may lead to unnecessarily reassigning a variables can be a huge pain
because it is difficult to decouple them.

4. What are the C storage classes?


There are four storage classes in C; auto, register, static and external.

5. What is the default scope level for a function?


The default scope level for a function is the Function block scope.

6. What is the default storage class for a library function?


The auto storage class is the default storage class for all local variables.

7. A register variable will always be placed in the register. Explain.


Register variable has faster access than a variable that is stored in the RAM.
Frequently used variables are kept in register and only few variables can be placed
inside register.

You might also like