Slideshow

Monday 25 February 2013


Q.9 Consider the following code segment:
int a[10], *p1, *p2;
p1 = &a[4];
p2 = &a[6];
Which of the following statements is incorrect w.r.t. pointers?
(A) p1 + 2 (B) p2 – 2
(C) p2 + p1 (D) p2 – p1


Ans: C
Addition of two pointers is not allowed.

No comments:

Post a Comment