Page t042, go to NEXT,
PREVIOUS, INDEX
Progression towards C style
Conventional style
sum = sum + *y;
y = y + 1;
Use add-and-assign operator
sum += *y;
y = y + 1;
Use postfix increment operator
sum += *y;
y++;
Combine postfix and dereference
sum += *y++;
- it takes some time to get used to this style
- don't do it if you are not comfortable with it
- the compiler will generate the same machine instructions either way
C Course, 22-jan-1997,
Peter Klok,
pfk@hef.kun.nl