Write pointer to file in C
- by Sergey
I have a stucture:
typedef structure student {
char *name;
char *surname;
int age;
} Student;
I need to write it to binary file.
Student *s = malloc(sizeof(*s));
I fill my structure with data and then i write in to the file:
fwrite(s, sizeof(*s), 1, fp);
In my file doesnt exist a name and surname, it have an adresses of char*.
How can i write to file a word, not an adresses?