Next: null-pointer, Previous: mem-aref, Up: Pointers [Contents][Index]
A pointer.
A foreign type.
An integer (in byte units).
The value ptr points to.
CFFI> (with-foreign-string (ptr "Saluton") (setf (mem-ref ptr :char 3) (char-code #\a)) (loop for i from 0 below 8 collect (code-char (mem-ref ptr :char i)))) ⇒ (#\S #\a #\l #\a #\t #\o #\n #\Null) CFFI> (setq ptr-to-int (foreign-alloc :int)) ⇒ #<A Mac Pointer #x1047D0> CFFI> (mem-ref ptr-to-int :int) ⇒ 1054619 CFFI> (setf (mem-ref ptr-to-int :int) 1984) ⇒ 1984 CFFI> (mem-ref ptr-to-int :int) ⇒ 1984