Im having issues with the redefintion of "fptr"
<p>The 15th line is what I cant fix. Please be kind enough to look at my code and diagnose the issue. I am new to programming and will appreciate anyone pointing me in the right direction. </p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

#define TEAMS 200
#define RUNNERS 10000
#define LENGTH 20
#define TEAMSIZE 50

FILE *fptr;
fptr = fopen("myfile.txt","w");
void getdetails();

struct person {
    char name[LENGTH];
    int number;
    int age;
    int event;
    float money;
    float time;
}p;

struct team {
    char tname[LENGTH];
    int nummembers;
    float money;
    struct person members[TEAMSIZE];
}t;

int main() {

    int c,flag=0,i=0,j,k=0;

    printf("\n---------------------------------------------------");
    printf("\n---------------------------------------------------");
    printf("\nHeader Specification");

    while(flag==0) {
        printf("\n1.Individual Registration");
        printf("\n2.Team Registration");
        printf("\n3.Running Events");
        printf("\n4.Donation Totals");
        printf("\n5.Exit");

        printf("\nEnter your choice:");
        scanf("%d",&amp;c);

        switch(c) {
        case 1:
            printf("\n For Individual Registration");
            printf("\n1.Early Registration");
            printf("\n2.regular Registration");
            int ch;

            printf("\nEnter your choice:");
            scanf("%d",&amp;ch);

            switch(ch) {
            case 1: 
                printf("\n For Early Registration");
                i=i+1;
                getdetails(i);
                break;
            case 2: 
                printf("\n For Early Registration");
                i=i+1;
                getdetails(i);
                break;

            default: 
                printf("\n not valid");
                break;
            }
            break;
        case 2:
            printf("\n For Team Registration");

            printf("\n Enter team name:");
            scanf("%s",t.tname);

            printf("\n Enter team participant number:");
            scanf("%d",&amp;t.nummembers);

            k=k+1;

            for(j=1;j&lt;=t.nummembers;j++) {
                getdetails(k);
            }
            break;
        case 5:
            flag=1;
            break;
        }
    }
     return 0;
}

void getdetails(int i) {

    printf("Enter your name:");
    scanf("%s",p.name);

    printf("Enter your age:");
    scanf("%d",&amp;p.age);

    printf("Enter the event:");
    scanf("%d",&amp;p.event);

    printf("Enter the donation amount:");
    scanf("%f",&amp;p.money);

    if(fptr == NULL) {
       printf("Error!");
       exit(1);
    }

    fprintf(fptr,"\n%s register for\t%dk race\tand the number is%d.",p.name,p.event,i);
    fclose(fptr);
}
</code></pre>