#include <stdio.h>
#include <malloc.h>

typedef struct {
    const char *field;
    
} struct_2;

typedef struct
{
    struct_2 *ptr_struct_2;
    const char *field; 
    
} struct_1; // this is for demonstration of comments bugs


/* ================================================== */
int main (int argc, char *argv[]) 
{
    struct_1 *ptr_struct_1;
    struct_2 *ptr_struct_2;

    /* alloc */
    ptr_struct_1 = (struct_1 *) malloc (1);
    ptr_struct_2 = (struct_2 *) malloc (1);
    
    /* init */
    ptr_struct_2->field = "foo";
    ptr_struct_1->field = "bar";
    ptr_struct_1->ptr_struct_2 = ptr_struct_2;

    printf ("value of ptr_struct_1->ptr_struct_2->field= %s\n", ptr_struct_1->ptr_struct_2->field); // this line is quite long but it is just for a demo
    
    return 0;
}

