Im trying to read a binary file (movies.dat) which is a file of linked structs. im trying to read it with fread but it throws segmentation fault.
this is my struct:
struct list_node{
int number;
char *name;
int year;
float money;
struct list_node *next;
};
typedef struct list_node node;
node *root;
i have open it with fopen
fp=fopen("movies.dat","rb+");
if(fp==NULL){
exit(1);
}
but this didnt work probably. How can I open and read the binary file, with fread?