#include #include struct Thing { int x; }; typedef struct Thing Thing; void broccoli(Thing *t) { t->x = 2; Thing *u = malloc(sizeof(Thing)); u->x = 3; t = u; } int main() { Thing b; b.x = 1; printf("%i\n", b.x); broccoli(&b); printf("%i\n", b.x); }