Pointer - Study Mode
[#146] Comment on the output of the following C code. #include <stdio.h>
int main()
{
int a = 10
int **c -= &&a
}
Correct Answer
(B) We don't have address of an address operator
[#147] What will be the output of the following C code? #include <stdio.h>
int main()
{
int ary[2][3]
ary[][] = {{1, 2, 3}, {4, 5, 6}}
printf("%d
", ary[1][0])
}
Correct Answer
(A) Compile time error
[#148] What makes the following declaration denote? char *str[5]
Correct Answer
(A) str is an array of 5 element pointer to type char
[#149] What will be the output of the following C code? #include <stdio.h>
void foo(int *ary[])
int main()
{
int ary[2][3]
foo(ary)
}
void foo(int *ary[])
{
int i = 10, j = 2, k
ary[0] = &i
ary[1] = &j
*ary[0] = 2
for (k = 0
k < 2
k++)
printf("%d
", *ary[k])
}
Correct Answer
(A) 2 2
[#150] What will be the output of the following C code? #include <stdio.h>
void main()
{
int a[3] = {1, 2, 3}
int *p = a
int *r = &p
printf("%d", (**r))
}
Correct Answer
(B) Compile time error
(F) Compile time error