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

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