Hey, I'm trying to return the position of the array so I can print the contents of a structure at that position, I run in to the problem of what if the array position is 0? This is a problem cause I also want to return 0 for false. How do I distinguish?
Code:int find_jock(struct athlete players[], int jock, int top) { int i = 0, found = 1; while (found == 1 && i < top) { if (jock == players[i].rank) return i; /* end if */ i++; } return 0;Code:display_jock(players[find_jock(players, 1, top)]);