Here we pass the array in function. We pass the base address of the base array which is zero. a[0]=A, a[1]=B, a[2]=C, a[3]=D.
Now a++ it means increment the address of the address 1 which store the value is B. In same a++ it will be 2, which print C.
Amar said:
(Wed, Oct 13, 2010 08:04:46 AM)
Since the array is declared of "char" type an increment i.e. a++ would make it point to the next of its type i.e. a[1] wich is B. Same for the next one.
K Vinayak said:
(Thu, Feb 3, 2011 06:14:17 AM)
Here in this program we are passing the starting address of array so it is received in *a and on pointers we can perform arithmatic operations a is incremented once and printed so the result is B it is again incremented and printed so the result C.
Sridhar said:
(Thu, May 12, 2011 01:18:17 AM)
*a means first we should see wat is address and 2ndly for which var address belongs to and wat is the value....here the address of *a is 1 and next a++ *a+1 is a(2) value is b
and again a++ a(3) value is c
Christopher said:
(Fri, Aug 12, 2011 12:54:43 PM)
I agree with Bagesh Kumar singh Point.
Pratik said:
(Sun, Nov 20, 2011 12:26:50 PM)
Wee when we are sending the addres of a[i], and incrementing it, so automaticaly address of a[i] will shift to a[i+1]. And hence it will print the content of net address a[i+1] as *a[i] is printed.