C Programming - Pointers - Discussion
|
|
|
|
Read more:"Life is like riding a bicycle. To keep your balance you must keep moving."
- Albert Einstein
|
|
Prachi Deshmukh said:
(Wed, Jun 9, 2010 02:07:17 AM)
|
|
| |
| How the value of D is 11? |
|
Sundar said:
(Mon, Jun 21, 2010 01:03:25 AM)
|
|
| |
Hi Prachi Deshmukh,
c = ++*ptra; --> This statement increments the value of 'a' and assings it to 'c'. Therefore 'a' and 'c' are equal.
d = (*ptrb)++; --> This statement assigns the value of 'b' to 'd',
then increases the value of 'b'. So, here 'd' is less than 'b'. |
|
Pragatheeswaran said:
(Mon, Jun 21, 2010 01:03:30 AM)
|
|
| |
If we use with directly in printf() ++*ptr is should equal to ++*(ptr).
Ex:
printf("%d", ++*ptr) is equal to printf("%d", ++*(ptr))
but not equal to printf("%d",(*ptr)++) |
|
Muhammad Alshad said:
(Thu, Jul 22, 2010 09:27:02 PM)
|
|
| |
| thanks sundar and pragtheesh |
|
Chandana said:
(Thu, Jul 29, 2010 10:12:46 AM)
|
|
| |
| thanks sundar |
|
Padma said:
(Mon, Aug 16, 2010 01:41:38 AM)
|
|
| |
| thanks sundar |
|
|