Name: Anonymous 2011-03-16 17:09
I know a good few hardcore C peeps lurk around here, is this possible?
(*p)++
(*p)++
int a[] by using (*a)++ as shown. What is the pointer a defined as? Multiples of 4 bytes? (For a 32-bit system, obviously.) Does that mean (char*)a would have to multiply the value by 4?
(*a)++ increments the value pointed at by the pointer. a++ increments the pointer itself.sizeof(a). Due to alignment and stuff if a is a structure, its size could be greater than the sum of sizes of the constituents.item_t * ptr, then ptr + n == (item_t *)((char*)ptr + n * sizeof(item_t))(define (setjmp! env)
(call/1cc (lambda (k)
(env-set! env k)
0)))
(define (longjmp! env val)
((env-get env)
(if (zero? val)
1
val)))