If storage class is missing in the array definition, by default it will be taken to be
A. | automatic |
B. | external |
C. | static |
D. | either automatic or external depending on the place of occurrence |
Option: D Explanation : If it is coming within a function, the storage class will be taken to be automatic. otherwise external Click on Discuss to view users comments. |
Consider the array definition
int num [10] = {3, 3, 3};
Pick the Correct answers
A. | num [9] is the last element of the array num |
B. | The value of num [ 8] is 3 |
C. | The value of num [ 3 ] is 3 |
D. | None of the above |
Option: A Explanation : Click on Discuss to view users comments. |
Consider the following type definition.
typedef char x[10];
x myArray[5];
What will sizeof(myArray) be ? (Assume one character occupies 1 byte)
A. | 15 bytes |
B. | 10 bytes |
C. | 50 bytes |
D. | 30 bytes |
Option: C Explanation : Click on Discuss to view users comments. |
While passing an array as an actual argument, the function call must have the array name
A. | with empty brackets |
B. | with its size |
C. | alone |
D. | none of the above |
Option: C Explanation : Click on Discuss to view users comments. |
The following program
main( )
{
static int a[ ] = { 7, 8, 9 } ;
printf( "%d", 2[ a ] + a[ 2 ] ) ;
}
A. | results in bus error |
B. | results in segmentation violation error |
C. | will not compile successfully |
D. | none of the above |
Option: D Explanation :
a[2] will be converted to *(a + 2). Click on Discuss to view users comments. |