random indentation isn't going to help much. You should also use more descriptive names for your variables. wins, losses, draws, points.... (assuming I'm guessing right)
from what I can tell this snippet of code is in the wrong spot, among other problems
Code:
scanf("%d",&tempgf2);
teams[team2].gf= teams[team2].gf+tempgf2;
teams[team2].p = teams[team2].p + 1;
I didn't actually fix anything, just the indentation and added a few comments
Code:
void detailentry(team* teams)
{
int i=0, team1=0, team2=0;
char teamname[20];
char teamname1[20];
int tempgf1;
int tempgf2;
//=============enter 1st team results============
printf("please enter team1 name\n"); //asks for input
scanf("%s",&teamname1); //checks whats been input
for(team1=0; team1 < 12; team1++) {
if(strcmp(teams[team1].name,teamname1)==0) {
printf("and score\n");
scanf("%d",&tempgf1);
teams[team1].gf = teams[team1].gf+tempgf1;
teams[team1].p = teams[team1].p + 1; //adds 1 to value of p
// NEED TO CALL IN VALUE OF GF2
// NEED to break out of loop now, team found and updated
// IF you don't break team1 will always be 12 after this loop
}else{
}
}
//=============enter second teams results==========
printf("please enter team2 name\n");
scanf("%s",&teamname);
for(team2=0; team2 < 12; team2++) {
if(strcmp(teams[team2].name,teamname)==0) {
printf("and score\n");
}else{
}
}
// Wrong Spot !?
scanf("%d",&tempgf2);
teams[team2].gf= teams[team2].gf+tempgf2;
teams[team2].p = teams[team2].p + 1;
printf("%d",tempgf1);
printf("%d",tempgf2);
/////At this stage tempgf1 and tempgf2 seem to stop working
teams[team2].ga = teams[team2].ga+tempgf1;
teams[team1].ga = teams[team1].ga+tempgf2;
if(tempgf1 > tempgf2){
teams[team1].w = teams[team1].w+1;
teams[team2].l = teams[team2].l+1;
}else if(tempgf1 < tempgf2) {
teams[team1].l=teams[team1].l+1;
teams[team2].w=teams[team2].w+1;
}else {
teams[team1].d=teams[team1].d+1;
teams[team2].d=teams[team2].d+1;
}
teams[team1].t=(teams[team1].w*3)+(teams[team1].d*1);
teams[team2].t=(teams[team2].w*3)+(teams[team2].d*1);
}