-
-
Save pkrll/1648b2ecd8f802dfd7974d3df60f9ac9 to your computer and use it in GitHub Desktop.
Question 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
struct bar { | |
char *g; | |
}; | |
struct foo { | |
struct bar *f; | |
int *y; | |
int *z; | |
}; | |
int main() { | |
//!showGraph() | |
int z; | |
struct foo *x = malloc(sizeof(struct foo)); | |
x->f = malloc(sizeof(struct bar)); | |
x->y = malloc(sizeof(int)); | |
x->f->g = "Hello World!"; | |
*x->y = 42; | |
z = *x->y; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment