What is the purpose of extern storage specifier?
Used to resolve the scope of a global symbol.
main() {
extern int i;
Printf(“%d”,i);
}
int i = 20;
When should we use the register storage specifier?
If a variable is used most frequently then it should be declared using register storage specifier, then possibly the compiler gives CPU register for its storage to speed up the lookup of the variable.
What are the different storage class specifiers in C?
The different storage specifiers available in C Language are as follows:
When should we use the register storage specifier?
We use Register Storage Specifier if a certain variable is used very frequently. This helps the compiler to locate the variable as the variable will be declared in one of the CPU registers.
What is the purpose of the keyword typedef?
It is used to alias the existing type. Also used to simplify the complex declaration of the type.
What are lvalue and rvalue?
The expression appearing on the right side of the assignment operator is called an rvalue. Rvalue is assigned to an lvalue, which appears on the left side of the assignment operator. The lvalue should designate as a variable not a constant.
Does a built-in header file contain a built-in function definition?
No, the header file only declares function. The definition is in the library which is linked by the linker.
Explain modular programming.
Dividing the program in to sub programs (modules/function) to achieve the given task is modular approach. More generic functions definition gives the ability to re-use the functions, such as built-in library functions.
How can you print a \ (backslash) using any of the printf() family of functions.
Escape it using \ (backslash).
Does a break is required by the default case in the switch statement?
Yes, if it is not appearing as the last case and if we do not want the control to flow to the following case after default if any.