Sail E0 Webinar

MCQs

Total Questions : 17 | Page 2 of 2 pages
Question 11.

What is meaning of following declaration?

int(*p[5])();

  1.    p is pointer to function.
  2.    p is array of pointer to function
  3.    p is pointer to such function which return type is array.
  4.    p is pointer to array of function. View Answer
 Discuss Question
Answer: Option B. -> p is array of pointer to function


In the above declaration the variable p is array not pointer.


Question 12. Void pointer can point to which type of objects?
  1.    int
  2.    float
  3.    double
  4.    all of the mentioned
 Discuss Question
Answer: Option D. -> all of the mentioned


Because it doesn't know the type of object it is pointing to, So it can point to all objects.


Question 13. What is size of generic pointer in c?
  1.    0
  2.    1
  3.    2
  4.    Null
 Discuss Question
Answer: Option C. -> 2


Size of any type of pointer is 2 byte.


Question 14. The pointer can point to any variable that is not declared with which of these?
  1.    const
  2.    volatile
  3.    both a & b
  4.    static
 Discuss Question
Answer: Option C. -> both a & b


both a & b


Question 15. When does the void pointer can be dereferenced?
  1.    when it doesn't point to any value
  2.    when it cast to another type of object
  3.    using delete keyword
  4.    none of the mentioned
 Discuss Question
Answer: Option B. -> when it cast to another type of object


By casting the pointer to another data type, it can dereferenced from void pointer.


Question 16. A void pointer cannot point to which of these?
  1.    methods in c++
  2.    class member in c++
  3.    both a & b
  4.    none of the mentioned
 Discuss Question
Answer: Option B. -> class member in c++


Because the class member will have a definite type, So it cannot pointed by a void pointer.


Question 17. What we can't do on a void pointer?
  1.    pointer arithemetic
  2.    pointer functions
  3.    both of the mentioned
  4.    none of the mentioned
 Discuss Question
Answer: Option A. -> pointer arithemetic


Because void pointer is used to cast the variables only, So pointer arithemetic can't be done in a void pointer.


Latest Videos

Latest Test Papers