C Pointer - C programming (MCQ) questions
Here, you can read C Pointer multiple choice questions and answers with explanation.
1) Which among the following is right? - Published on 26 Feb 17
a. sizeof(struct stemp*) > sizeof(union utemp*) > sizeof(char *)
b. sizeof(struct stemp*) < sizeof(union utemp*) < sizeof(char *)
c. sizeof(struct stemp*) = sizeof(union utemp*) = sizeof(char *)
d. The order Depends on the compiler
Answer
Explanation
|
ANSWER: sizeof(struct stemp*) = sizeof(union utemp*) = sizeof(char *)
Explanation: No explanation is available for this question!
|
|
2) What do the following declaration signify?
char **argv; - Published on 26 Feb 17
a. argv is a pointer to pointer.
b. argv is a pointer to a char pointer.
c. argv is a function pointer.
d. argv is a member of function pointer.
Answer
Explanation
|
ANSWER: argv is a pointer to a char pointer.
Explanation: No explanation is available for this question!
|
|
3) What do the following declaration signify?
int (*pf)(); - Published on 26 Feb 17
a. pf is a pointer to function.
b. pf is a function pointer.
c. pf is a pointer to a function which return int
d. pf is a function of pointer variable.
Answer
Explanation
|
ANSWER: pf is a pointer to a function which return int
Explanation: No explanation is available for this question!
|
|
4) What do the following declaration signify?
char *arr[10]; - Published on 26 Feb 17
a. arr is a array of 10 character pointers.
b. arr is a array of function pointer.
c. arr is a array of characters.
d. arr is a pointer to array of characters.
Answer
Explanation
|
ANSWER: arr is a array of 10 character pointers.
Explanation: No explanation is available for this question!
|
|
5) How will you free the memory allocated by the following program?
#include<stdio.h> #include<stdlib.h> #define MAXROW 3 #define MAXCOL 4 int main() { int **p, i, j; p = (int **) malloc(MAXROW * sizeof(int*)); return 0; } - Published on 26 Feb 17
a. memfree(int p);
b. dealloc(p);
c. malloc(p, 0);
d. free(p);
Answer
Explanation
|
ANSWER: free(p);
Explanation: No explanation is available for this question!
|
|
6) What is x in the following program?
#include<stdio.h> int main() { typedef char (*(*arrfptr[3])())[10]; arrfptr x; return 0; } - Published on 26 Feb 17
a. x is a pointer
b. x is an array of three pointer
c. x is an array of three function pointers
d. Error in x declaration
Answer
Explanation
|
ANSWER: x is an array of three function pointers
Explanation: No explanation is available for this question!
|
|
7) In the following code what is 'P'?
typedef char *charp; const charp P; - Published on 26 Feb 17
a. P is a constant
b. P is a character constant
c. P is character type
d. None of the above
Answer
Explanation
|
ANSWER: P is a constant
Explanation: No explanation is available for this question!
|
|
8) In the following code, the P2 is Integer Pointer or Integer?
typedef int *ptr; ptr p1, p2; - Published on 26 Feb 17
a. Integer
b. Integer pointer
c. Error in declaration
d. None of the above
Answer
Explanation
|
ANSWER: Integer pointer
Explanation: No explanation is available for this question!
|
|
9) How will you free the allocated memory? - Published on 26 Feb 17
a. remove(var-name);
b. free(var-name);
c. delete(var-name);
d. dalloc(var-name);
Answer
Explanation
|
ANSWER: free(var-name);
Explanation: No explanation is available for this question!
|
|
10) What does the following declaration mean?
int (*ptr)[10]; - Published on 26 Feb 17
a. ptr is array of pointers to 10 integers
b. ptr is a pointer to an array of 10 integers
c. ptr is an array of 10 integers
d. ptr is an pointer to array
Answer
Explanation
|
ANSWER: ptr is a pointer to an array of 10 integers
Explanation: No explanation is available for this question!
|
|