Pointer incrementation and assignme

root at mirror.TMC.COM root at mirror.TMC.COM
Fri May 26 22:48:00 AEST 1989


The compiler knows the size of the data that you are working with.
a+=1 and a = a+1 will still increment the pointer by 2.

The same way the compiler knows how to increment ints, floats, longs,
and doubles, it knows how to correctly increment any pointer, no matter
what the syntax that you use.  

In reality
the command a++ is just shorthand for a+=1 and a = a+1.  It was origionally
made for lines like:

	whatchamacallit = whatchamacallit + 1;

Carnigan and Ritchie were programmers who didn't like to type.



More information about the Comp.lang.c mailing list