the program stop working... HELP!

here is a function that I just created:

void maioraposta (jogador * j, int f){
int a,b=0;
for (a=0; a<f; a++){
if (j[a].aposta>b){b=j[a].aposta;}
}
for (a=0; a<j; a++){
if (b==j[a].aposta){j[a].maior=1;}
else {j[a].maior=0;}
printf ("\n%d",j[a].maior);
}
}

If I run the program without using it, there is no problem.
But if I use it, the program compile, with no problem, but can't run properly. Any ideas?
thanks.
a<j should be a<f. When you post code, put it into code tags.
Topic archived. No new replies allowed.