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?

So I get a "segmentation fault (core dumped)" when i run this

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

code. It's in C language, but I cant find the cause of

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!