C Language MCQ - English
Pointer MCQ Questions and Answers
Home | C Language | PointerIn this section we provide lots of objective question of Pointer
1) What is (void*)0?
Answer : A Discuss
2) Can you combine the following two statements into one? char *p;
p = (char*) malloc(100);
Answer : C Discuss
3) In which header file is the NULL macro defined?
4) How many bytes are occupied by near, far and huge pointers (DOS)?
5) If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?
6) What would be the equivalent pointer expression for referring the array element a[i][j][k][l]
7) A pointer is
Answer : C Discuss
8) The operator used to get value at address stored in a pointer variable is
9) What will be the output of the following C code?#include <stdio.h>
int main()
{
char *p = NULL;
char *q = 0;
if (p)
printf(" p ");
else
printf("nullp");
if (q)
printf("q\n");
else
printf(" nullq\n");
}
Answer : A Discuss
10) What will be the output of the program ? #include<stdio.h>
int main()
{
static char *s[] = {"black", "white", "pink", "violet"};
char **ptr[] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
++p;
printf("%s", **p+1);
return 0;
}