about summary refs log tree commit diff
path: root/examples/18.src
blob: 90234c4ccc236020cad59ab792dccf1b819cb008 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extern printf = (*i64, varargs) => void;
extern malloc = (i64) => *i64;
extern free = (*i64) => void;

let main = () => i64 {
	let x = malloc(128);
	/*
	*(x+0) = 10;
	*(x+8) = 20;
	*/
	printf("%p\n", x);
	printf("%d\n", *x);
	printf("%d\n", *(x+1));
	free(x);
	return 0;
};