So I have a struct that looks something like this (more or less):

```
typedef struct AST_STRUCT
{
    enum {
        AST_OBJECT,
        AST_REFERENCE,
        AST_VARIABLE,
        AST_VARIABLE_DEFINITION,
        AST_VARIABLE_ASSIGNMENT,
        AST_VARIABLE_MODIFIER,
        AST_FUNCTION_DEFINITION,
        AST_FUNCTION_CALL,
        AST_NULL,
        AST_STRING,
        AST_CHAR,
        AST_FLOAT,
        AST_LIST,
        AST_BOOLEAN,
        AST_INTEGER,
        AST_COMPOUND,
        AST_TYPE,
        AST_BINOP,
        AST_NOOP,
        AST_BREAK,
        AST_RETURN,
        AST_IF,
        AST_ELSE,
        AST_WHILE,
        AST_ATTRIBUTE_ACCESS,
        AST_LIST_ACCESS,
        AST_NEW
    } type;

    struct AST_STRUCT* variable_value;
}

```

Now I would like to write this struct, serialized to the disk into a `.dat` file.
The problem is that as you can see, it has a field called `variable_value` .

I am using this function to write it to disk:
<https://www.geeksforgeeks.org/readwrite-structure-file-c/>

I am also using the other function in that article to read it from the disk.
It appears as if the `variable_value` field on the struct is not loaded properly.
How would I write the entire struct to disk and maintain the data of the `variable_value` field?

I was first thinking about dumping the `variable_value` field into a separate file and then sort of "link it back" into the struct once I load it, but maybe there is another way of doing this?