#include <stdlib.h> #include <stdio.h> struct B { int blah2; }; struct A { int blah; struct B * struct_b; }; int main(int argc, char ** argv) { struct A * struct_a = malloc(sizeof(struct A)); struct_a->struct_b = malloc(sizeof(struct B)); struct_a->blah = 3; struct_a->struct_b->blah2 = 4; return 0; }