Pointers in C Programming MCQ (Multiple Choice Questions And Answers)
Are you preparing for the next job interviews? If yes, trust me this post will help you also we'll suggest you check out a big collection for Programming Full Forms that may help you in your interview:
List of Programming Full Forms
- Error
- Representation of void pointer
- Representation of NULL pointer
- Both B and C
- the same as int *p[5];
- p is a one dimensional array of size 5, of pointers to integers
- Both A and B
- p is a pointer to a 5 element integer array
#include <stdio.h>
int main()
{
int i = 97, *p = &i;
foo(&i);
printf("%d ", *p);
}
void foo(int *p)
{
int j = 2;
p = &j;
printf("%d ", *p);
}
- 2 2
- 2 24
- 2 97
- Compilation error
- int array[5] = {};
- int array[5] = {0};
- int a = 0, b = 0, c = 0; int array[5] = {a, b, c};
- All of the above
#include <stdio.h>
int main()
{
int ary[4] = {1, 2, 3, 4};
int p[4];
p = ary;
printf("%d\n", p[1]);
}
- Compile time error
- 1
- 2
- Run time error