> I'm in your prog. langs. class. I have a question about a > homework problem. I think the problem is problem 2.2. It's this one: > > a+++++b; > > I think I know what this is supposed to do: > Increment b; > Add a and b; > Increment a; > > I decided to code this up. Just to make sure... > > compiler 'cc' gave me this error: illegal lhs of assignment operator > compiler 'gcc' gave me this error: invalid lvalue in increment > > I think my code is correct. Is this a problem with both compilers ?? > Here is my code below: > > main() > { > int a = 1; > int b = 1; > > a+++++b; > printf("a => %d ; b => %d\n",a,b); > } -----------------------------------------------------> You do have the partial answer (i.e., the expression is illegal). The answer you must come up with is why it is so. Look up a language manual to figure out why.