The assignment to variable has no effect?
问题 When I do this: count = ++count; Why do i get the warning - The assignment to variable count has no effect ? This means that count is incremented and then assigned to itself or something else ? Is it the same as just ++count ? What happens in count = count++; ? Why don't I get a warning for this ? 回答1: count++ and ++count are both short for count=count+1 . The assignment is built in, so there's no point to assigning it again. The difference between count++ (also knows as postfix ) and ++count