Reputation: 1
My function wont be called. This function should work like it would ask for the name,username,password and balance of a certain member just like what it does in main.
void addMember(player p[], int max){
int a;
for(a=max-1;a==max;a++){
putname(p,a);
userN(p,a);
passW(p,a);
Bal(p,a);
printf("\n");
}
}
main(void){
int max = 1, a,choice;
player p[max];
welcome();
getch();
system("cls");
for(a=0;a<max;a++){
system("cls");
printf("\n\t\tNOTE: DON''T LEAVE ANYTHING BLANK\n");
printf("\n\t\t\t CUSTOMER %d\n", a+1);
putname(p,a);
userN(p,a);
passW(p,a);
Bal(p,a);
printf("\n");
}
}
Upvotes: 0
Views: 76
Reputation: 358
You have a for loop
for(a=max-1;a==max;a++)
here you provided a condition a==max which will not be satisfied and the loop body will not getting executed and will not enter in the loop body even once. You have to look on your for loop condition, it should be appropriate.
Upvotes: 2