Reputation: 817
I have this function
int does_exist_in_array(char team[], struct team *teams) {
int i;
for(i = 0; i < MAX_TEAMS_AMOUNT; i++) {
if(!strcmp(team, teams[i].name)) {
return 1;
}
}
return 0;
}
It crashes when i run the application. Anyone know what is wrong? Do i use it wrong?
Upvotes: 0
Views: 5992
Reputation: 182639
This can happen for a number of reasons:
MAX_TEAMS_AMOUNT
team
elementsUpvotes: 5