71. What is static memory allocation?
Ans: Compiler allocates memory space for a declared variable. By using the address of operator, the
reserved address is obtained and this address is assigned to a pointer variable. This way of assigning pointer value to a pointer variable at compilation time is known as static memory allocation.
72. What is the purpose of realloc?
Ans: It increases or decreases the size of dynamically allocated array. The function realloc (ptr,n) uses two arguments. The first argument ptr is a pointer to a block of memory for which the size is to be altered. The second argument specifies the new size. The size may be increased or decreased. If sufficient space is not available to the old region the function may create a new region.
Ans: Compiler allocates memory space for a declared variable. By using the address of operator, the
reserved address is obtained and this address is assigned to a pointer variable. This way of assigning pointer value to a pointer variable at compilation time is known as static memory allocation.
72. What is the purpose of realloc?
Ans: It increases or decreases the size of dynamically allocated array. The function realloc (ptr,n) uses two arguments. The first argument ptr is a pointer to a block of memory for which the size is to be altered. The second argument specifies the new size. The size may be increased or decreased. If sufficient space is not available to the old region the function may create a new region.
Advertisement
73. What is an array of pointers?
Ans: if the elements of an array are addresses, such an array is called an array of pointers.
74. Difference between linker and linkage?
Ans: Linker converts an object code into an executable code by linking together the necessary built in
functions. The form and place of declaration where the variable is declared in a program determine the linkage of variable.
Ans: if the elements of an array are addresses, such an array is called an array of pointers.
74. Difference between linker and linkage?
Ans: Linker converts an object code into an executable code by linking together the necessary built in
functions. The form and place of declaration where the variable is declared in a program determine the linkage of variable.
Advertisement
75. Is it possible to have negative index in an array?
Ans: Yes it is possible to index with negative value provided there are data stored in this location. Even if it is illegal to refer to the elements that are out of array bounds, the compiler will not produce error because C has no check on the bounds of an array.
76. What modular programming?
Ans: If a program is large, it is subdivided into a number of smaller programs that are called modules or subprograms. If a complex problem is solved using more modules, this approach is known as modular programming.
77. What is a function?
Ans: A large program is subdivided into a number of smaller programs or subprograms. Each subprogram
specifies one or more actions to be performed for the larger program. Such sub programs are called functions.
78. What are built in functions?
Ans: The functions that are predefined and supplied along with the compiler are known as built-in functions. They are also known as library functions.
79. Difference between formal argument and actual argument?
Ans: Formal arguments are the arguments available in the function definition. They are preceded by
their own data type. Actual arguments are available in the function call. These arguments are given
as constants or variables or expressions to pass the values to the function.
80. What is the difference between an enumeration and a set of pre-processor # defines?
Ans: There is hardly any difference between the two, except that #defines has a global effect (throughout the file) whereas an enumeration can have an effect local to the block if desired. Some advantages of enumeration are that the numeric values are automatically assigned whereas in #define we have to explicitly define them. A disadvantage is that we have no control over the size of enumeration variables.
Ans: Yes it is possible to index with negative value provided there are data stored in this location. Even if it is illegal to refer to the elements that are out of array bounds, the compiler will not produce error because C has no check on the bounds of an array.
76. What modular programming?
Ans: If a program is large, it is subdivided into a number of smaller programs that are called modules or subprograms. If a complex problem is solved using more modules, this approach is known as modular programming.
77. What is a function?
Ans: A large program is subdivided into a number of smaller programs or subprograms. Each subprogram
specifies one or more actions to be performed for the larger program. Such sub programs are called functions.
78. What are built in functions?
Ans: The functions that are predefined and supplied along with the compiler are known as built-in functions. They are also known as library functions.
79. Difference between formal argument and actual argument?
Ans: Formal arguments are the arguments available in the function definition. They are preceded by
their own data type. Actual arguments are available in the function call. These arguments are given
as constants or variables or expressions to pass the values to the function.
80. What is the difference between an enumeration and a set of pre-processor # defines?
Ans: There is hardly any difference between the two, except that #defines has a global effect (throughout the file) whereas an enumeration can have an effect local to the block if desired. Some advantages of enumeration are that the numeric values are automatically assigned whereas in #define we have to explicitly define them. A disadvantage is that we have no control over the size of enumeration variables.