*ptr++ and ++*ptr are they representing the same expression if not then how they are different according to precedence ?
daredevil786
0
Newbie Poster
Recommended Answers
Jump to PostI refuse to answer, on the grounds that you should be enthusiastically TESTING this yourself. ;)
Put down your latte, take 30 seconds, and test it, FCOLoud!
Jump to PostNo, I can't tell you, because on my compiler, if:
int n=3; int *ptr; ptr = &n; ++*ptr; printf("\n%d", *ptr);
prints out: 4
So ++*ptr is the same as ++(*ptr).
*ptr++, on the other hand, is the same as *(++ptr) - meaning it does increment …
All 7 Replies
Adak
419
Nearly a Posting Virtuoso
daredevil786
0
Newbie Poster
Adak
419
Nearly a Posting Virtuoso
rajsekhar28
0
Newbie Poster
Adak
419
Nearly a Posting Virtuoso
daredevil786
0
Newbie Poster
Adak
419
Nearly a Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.