Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (setq array (native "@" "malloc" 'N 41)) #alloc 10*4, sapce for 10 elemts of sizeof(int)
- (struct array 'N '(255 . 8)) #we set 255 in array[0]
- (prinl (struct (+ array 0) '(N))) #we read array[0] == 255 YAY!!!
- (prinl "here we go:")
- (setq k 0)
- (let i 0
- (loop
- (struct (+ array k) 'N '(i . 8))
- (setq k (+ k 4)) #one step is sizeof(int) wide -> 4
- (T (= 10 (inc 'i))) ) )
- (setq k 0)
- (let i 0
- (loop
- (prinl (struct (+ array k) '(N)))
- (setq k (+ k 4))
- (T (= 10 (inc 'i))) ) )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement