Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (27 sloc) 0.573 kb
#include <stdlib.h>
typedef struct {
long *ptr;
} Structy;
long _deref(long *ptr) {
return *ptr;
}
long *make_ptr() {
long *ptr = (long *) malloc(sizeof(long));
*ptr = 32;
return ptr;
}
void struct_twiddle(Structy *s) {
s->ptr = (long *) malloc(sizeof(long));
*(s->ptr) = 9;
}
void array_twiddle(long **arr) {
arr[0] = (long *) malloc(sizeof(long));
arr[1] = (long *) malloc(sizeof(long));
arr[2] = (long *) malloc(sizeof(long));
*arr[0] = 1;
*arr[1] = 2;
*arr[2] = 3;
}
void dummy(void **arr) {
/* dummy */
}
Jump to Line
Something went wrong with that request. Please try again.