hello,
in the following question
c=4;
d= (++c)++; //It works in gcc compiler
d= (c++)++; //it didn't work
what i have read that ++c or c++ returns a value which can't be again incremented or decremented (like 5++).
i want to know how the first statement works and second statement do not?
please help me in this question.........
jitendra.theta 0
Newbie Poster
Recommended Answers
Jump to PostPrefix increment/decrement operators return lvalue (a reference to operator argument in C++ terms) so it's possible to increment/decrement this lvalue. Postfix increment/decrement operators return rvalue (a value as is, not a reference to) so it's impossible to increment this value (it's not a variable).
All 2 Replies
Reply to this topic
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.