Why fread functions in C language can't use structure pointers

I use the fread () function to write to my own defined structure pointer, but this reports an error. The
problem occurs where I commented.

typedef struct Student {
    char *name;
} Student;

int main() {
    Student stu = {12, "Danny"};
    FILE *out;
    if ((out = fopen("out.dat", "w")) == NULL) {
        printf("ERROR\n");
        return 0;
    }

    fwrite(&stu, sizeof(Student), 1, out);
    fclose(out);


    FILE *in;
    if((in = fopen("out.dat", "r")) == NULL) {
        printf("ERROR\n");
        return 0;
    }

    Student *stu2;
    fread(stu2, sizeof(Student), 1, in); // 
    printf("%s", stu2->name);
    return 0;
}
C
Jul.04,2022

how to write text content without a single wild pointer allocated memory

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-15cfb21-7d3e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-15cfb21-7d3e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?