Code: Show/Hide struct
{ char name[32]; } teamdata[10]; ... int team; printf("team #? "); team = -1; scanf("%d", &team); if (team >= 0 && team < 10) { printf("ok what will you name it? "); scanf("%31s", teamdata[team].name); teamdata[31] = 0; } |
Code: Show/Hide int currentteam;
currentteam = 0; //input loop while(currentteam < 10 && ... /* whatever else, like quit conditions */) { ... scanf("%31s", teamdata[currentteam].name); ... // lastly increase currentteam by 1 to move to the next slot currentteam++; } |
Code: Show/Hide if (!strcmp (choice[7], "")) /*see if data for choice is blank*/ |