关于C语言文本类型输入

要做一个学生学籍管理系统,但是到文本输入的时候输进去了,txt文件也创建好了,打开文件就是一片空白,请各位帮帮忙,这是我的那一部分代码

#include
#include

typedef struct Student{
long StudentID; //学生学号
char StudentName[4]; //学生名字
char StudentSex; //学生性别
int StudentScore; //学生成绩
}STUDENT;

FILE *fp;
int find = 0; // 用于控制循环
char ch;//用于储存命令
STUDENT student;//定义一个结构体变量
if ((fp = fopen ("StudentInformation.txt", "a") == NULL))
{
    printf ("Failure to open student.txt\n");
    exit(0);
}
else
{
    // 录入数据
    while (find == 0)
    {
        do {
            printf ("请输入学生学号(9位数字,例:161110500):\n");
            scanf ("%ld", &student.StudentID);
            getchar();
            printf ("请输入学生姓名:(4个字以内)\n");
            gets(&student.StudentName);
            printf ("请输入学生性别(男或女):\n");
            scanf (" %c", &student.StudentSex);
            getchar();
            printf ("请输入学生成绩:\n");
            scanf ("%d", &student.StudentScore);

            printf ("是否输入正确?(按Y正确,按N重输)\n");
            ch = getch();
            system("cls");
        } while (ch == 'N' || ch == 'n');
        fprintf (fp, "%ld", student.StudentID);
        fprintf (fp, "%s", student.StudentName);
        fprintf (fp, "%c", student.StudentSex);
        fprintf (fp, "%d", student.StudentScore);
        printf ("是否继续输入下一个学生成绩?(按Y继续,按N返回)\n");
        ch = getch();
        if (ch == 'Y' || ch == 'y')
        {
            find = 0;
        }
        else if (ch == 'N' || ch == 'n')
        {
            find = 1;
        }
        else
        {
            printf ("输入错误,即将返回\n");
            find = 1;
        }
    }
}

我调了下你的程序,只是把if ((fp = fopen ("StudentInformation.txt", "a") == NULL))里的fp = fopen()放到了外边,可以出结果的呀。txt存到数据了