Question: So I get a segmentation fault (core dumped) when i run this code. It's in C language, but I cant find the cause of it
So I get a "segmentation fault (core dumped)" when i run this code. It's in C language, but I cant find the cause of it could somebody point it out and help fix it?

These are the functions made for this program( not including save, that's for another problem)

void print_monster(struct monster m){ printf("Name: \%sType: \%sHP: \%d \ nLevel: \%d \ ", m.name, m.type, m.hp, m.level); void save_monster(struct monster m, FILE* fp){ fwrite(\&m, sizeof(m), 1,fp); \} struct monster load_monster(FILE* fp){ struct monster m; fread(\&m, sizeof(m), 1,fp); return m
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
