increment or decrement operators basically increment values and assigns the value to a variable.so it expects a variable on the left hand side.so since constants cannot be placed on left hand side it reports lvalue error
On Mon, Aug 8, 2011 at 11:12 PM, Anil Arya <[email protected]> wrote: > @nitin no increment or decrement operation on constant value..It's > invalid....:) > > > On Mon, Aug 8, 2011 at 10:47 PM, Nitin <[email protected]> wrote: > >> main() >> { >> int i=10; >> int z; >> z=--i--; >> } >> this gives an lvalue required error ,what i want to know is when the post >> decrement gets executed then whether the expression should be --i or --10,as >> it is --10 thats y its givin lvalue required error but y is it so as if we >> increment or decrement using post or pre operator variable is updated not it >> is replaced by value.??? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > Anil Kumar Arya > B.Tech III year > computer science & engineering > M.N.N.I.T Allahabad. > > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
