Pointer - Study Mode

[#206] What is the size of *ptr in a 32-bit machine (Assuming initialization as int *ptr = 10
)?
Correct Answer

(C) 4

[#207] What will be the output of the following C code? #include <stdio.h>
void f(int (*x)(int))
int myfoo(int)
int (*foo)() = myfoo
int main()
{
f(foo)
}
void f(int(*i)(int ))
{
i(11)
}
int myfoo(int i)
{
printf("%d
", i)
return i
}
Correct Answer

(B) 11

[#208] Comment on the following 2 arrays with respect to P and Q. int *a1[8]
int *(a2[8])
P. Array of pointers
Q. Pointer to an array
Correct Answer

(B) a1 is P, a2 is P

[#209] What will be the output of the following C code? #include <stdio.h>
int main()
{
int i = 10
void *p = &i
printf("%f
", *(float*)p)
return 0
}
Correct Answer

(D) 0.000000

[#210] What will be the output of the following C code? #include <stdio.h>
void main()
{
struct student
{
int no
char name[20]
}
struct student s
no = 8
printf("%d", no)
}
Correct Answer

(B) Compile time error