注册 登录
编程论坛 VC++/MFC

求助:成绩管理系统 改了半天 还是出错。。。

发布于 2010-12-11 21:57, 798 次点击
代码太长,占两层楼发。。。
程序代码:
#include <iostream>
#include <string>
#include<fstream>
#include<iomanip>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int amount=0;           //记录学生个数
int v;
ofstream *file[50];
/////////////////////////////////*个人信息结构体*////////////////////////////////////////
struct person
{
    int  ID;
    string  name;
    string  sex;
    string   age;
    string  call;
    string sc1;
    string sc2;
    string sc3;
    string sc4;
    string sc5;
    string  yzm1;
};
/////////////////////////////////*输入个人信息结构体*////////////////////////////////////////
struct student
{
    int  ID;
    string  name;
    string  sex;
    string   age;
    string  call;
    string sc1;
    string sc2;
    string sc3;
    string sc4;
    string sc5;
    string  yzm1;
    struct student *next;
};
/////////////////////////////////*班级信息结构体*/////////////////////////////////////
struct classs
{
    struct person per[50];
    int   yzm2;
    int   classnum;
}classs[4];
/////////////////////////////////*函数声明*////////////////////////////////////////
void input(student *head,int a);            //录入
void search1(student *head,int a) ;         //姓名查询
void search2(student *head,int a);          //学号查询
void change(student *head,int a);            //修改
void shanchu(student *head,int a);        //删除
void show(student *head,int a);        //显示数据
void readin1(student *head);          //保存数据1
void readin2(student *head);          //保存数据2
void readin3(student *head);          //保存数据3
void readin4(student *head);          //保存数据4
void gm();                          //管理员界面
void teacher();                     //老师界面
void student();                     //学生界面
void go();                          //主界面
void go1();                         //管理员登入
void go2();                         //老师登入
void go3();                         //学生登入
void load1(int a);                      //导入1
void load2(int a);                      //导入2
void load3(int a);                      //导入3
void load4(int a);                      //导入4
/////////////////////////////////*主函数*////////////////////////////////////////

void main()
{
    system("color f1");
    char x;
    bool flag2=0;
    student *head=new student;               //初始化学生数据
    head->next=NULL;
    cout<<"                        ★ 欢迎使用学生信息管理系统 ★        \n ";
    go();
    do
    {
        do
        {
            cin>>x;
            if((x>='0'&&x<='8'))
                flag2=1;
            else
            {
                cout<<"指令错误!!!!!!!!!!"<<endl;
                cout<<" 请选择相应的数字进行操作: ";
            }
        }while(flag2==0);
        switch(x)
        {
        case '0':go1();break;/*管理员*/
        case '1':go2();break;/*老师*/
        case '2':go3();break;/*学生*/
        case '3':
            cout<<"********************************************************************************\n";
            cout<<"               ¤  您已退出学生信息管理系统, 谢谢您的使用!  ¤                  \n";         
            cout<<"********************************************************************************\n";
            cout<<endl;
            exit(0);
            break;
        }
    }while(flag2==1);
}

void gm()/*帐号001 验证码0001*/
{
    cout<<"            ++++++++++**********++++++++++**********++++++++++\n";
    cout<<"            $                      菜  单                      $\n";
    cout<<"           $                     ^^^^^^^^^^                     $\n";   
    cout<<"          $          请选择:                                     $\n";
    cout<<"          $     [0]-班级添加;    [1]-班级修改;    [2]-删除班级;   $\n";
    cout<<"           $    [3]-学生登记;    [4]-学生修改;    [5]-删除学生;  $\n";
    cout<<"            $   [6]-查询;        [7]-导入;        [8]-保存;    $\n";
    cout<<"             $                   [9]-排序;                    $\n";
    cout<<"             **********++++++++++**********++++++++++**********\n";
    cout<<" 请选择相应的数字进行操作: ";
    char x;
    do
    {
        do
        {
            cin>>x;
            if((x>='0'&&x<='9'))
                flag2=1;
            else
            {
                cout<<"指令错误!!!!!!!!!!"<<endl;
                cout<<" 请选择相应的数字进行操作: ";
            }
        }while(flag2==0);
        switch(x)
        {
        case'0':break;
        case'1':break;
        case'2':break;
        case'3':
            {
                int a;
                cout<<"******************************现在进行学生信息录入******************************\n";
                cout<<"******************************请输入学生班级编号******************************\n";
                cout<<"                       班级编号:"; scanf("%d",&a);cout<<"\n";
                input(head,a);
                cout<<"输入的学生信息为:\n";
                show(head,a);
                cout<<"********************************************************************************\n";
                gm();break;}
        case'4':
            {
                int a;
                cout<<"******************************现在进行学生信息修改******************************\n";
                cout<<"                       班级编号:"; scanf("%d",&a);cout<<"\n";
                change(head,a);
                cout<<"********************************************************************************\n";
                gm();break;}
        case'5':{
            int a;
            cout<<"******************************现在进行学生信息删除******************************\n";
            cout<<"                       班级编号:"; scanf("%d",&a);cout<<"\n";
            shanchu(head,a);
            show(head,a);
            cout<<"********************************************************************************\n";gm();break;}
        case'6':
            {
                char z;
                cout<<"******************************现在进行学生信息查询******************************\n";
                cout<<"请选择查询方式:";
                cout<<"(0).姓名查询;(1).学号查询:";  cin>>z;
                while(z!='0'&&z!='1')
                {
                    cout<<"指令错误<请选择(0)或者(1)!>!!!!!!!"<<endl;
                    cout<<"请选择查询方式:(0).姓名查询;(1).学号查询:"; cin>>z;      
                }
                switch(z)
                {int a;
                case '0':
                    {cout<<"                       班级编号:"; scanf("%d",&a);cout<<"\n";
                  
                    search1(head,a);break;}//按姓名查询
                case '1': {cout<<"                       班级编号:"; scanf("%d",&a);cout<<"\n";
                    search2(head,a);break;}//按学号查询
                }   
                cout<<"********************************************************************************\n";gm();break;
                case'7':
                    {
                        int a;
                        cout<<"******************************现在进行导入学生信息******************************\n";
                        cout<<"                       班级编号:"; scanf("%d",&a);cout<<"\n";
                        switch(a)
                        {case '1':load1(a);break;
                        case '2':load2(a);break;
                        case '3':load3(a);break;
                        case '4':load4(a);break;
                        }
                        cout<<"********************************************************************************\n";
                        gm();break;
                       
                        case'8':{
                            cout<<"******************************现在进行保存学生信息******************************\n";
                            cout<<"                       班级编号:"; scanf("%d",&a);cout<<"\n";
                            switch(a)
                            {case '1':readin1(head);break;
                            case '2':readin2(head);break;
                            case '3':readin3(head);break;
                            case '4':readin4(head);break;
                            }
                            cout<<"********************************************************************************\n";
                            gm();break;
                            case'9':break;
                                }
                    }while(flag2==1);
            }
           
            /////////////////////////////////*录入学生数据*////////////////////////////////////////
        void input(student *head,int a)
            {
                int  ID;
                string  name;
                string  sex;
                string   age;
                string  call;
                string sc1;
                string sc2;
                string sc3;
                string sc4;
                string sc5;
                string  yzm1;
                char c;
                int j=0;
                student *p=head;
                do
                {
                  
                    student *stu=new student;
                    cout<<"请输入学号(9位数字):"<<setw(9); cin>>(*stu).ID;
                    cout<<"请输入姓名:"<<setw(20);         cin>>(*stu).name;
                    cout<<"请输入性别:"<<setw(20);         cin>>(*stu).sex;
                    cout<<"请输入年龄:"<<setw(20);         cin>>(*stu).age;
                    cout<<"电话:"<<setw(8);         cin>>(*stu).call;
                    cout<<"请输入成绩1:"<<setw(2);         cin>>(*stu).sc1;
                    cout<<"请输入成绩2:"<<setw(2);         cin>>(*stu).sc2;
                    cout<<"请输入成绩3:"<<setw(2);         cin>>(*stu).sc3;
                    cout<<"请输入成绩4:"<<setw(2);         cin>>(*stu).sc4;
                    cout<<"请输入成绩5:"<<setw(2);         cin>>(*stu).sc5;
                    ID=(*stu).ID;
                    name=(*stu).name;
                    sex=(*stu).sex;
                    age=(*stu).age;
                    call=(*stu).call;
                    sc1=(*stu).sc1;
                    sc2=(*stu).sc2;
                    sc3=(*stu).sc3;
                    sc4=(*stu).sc4;
                    sc5=(*stu).sc5;
                    yzm1=ID+5;
                    classs[a].per[amount].ID=ID;
                    classs[a].per[amount].name=name;
                    classs[a].per[amount].sex=sex;
                    classs[a].per[amount].age=age;
                    classs[a].per[amount].call=call;
                    classs[a].per[amount].sc1=sc1;
                    classs[a].per[amount].sc2=sc2;
                    classs[a].per[amount].sc3=sc3;
                    classs[a].per[amount].sc4=sc4;
                    classs[a].per[amount].sc5=sc5;
                    classs[a].per[amount],yzm1=yzm1;
                    stu->next=p->next;
                    p->next=stu;
                    amount++;
                    cout<<"数据录入成功,想继续录入吗(y/n)";  cin>>c;
                    p=p->next;
                    while(c!='y'&&c!='n')
                    {
                        cout<<"指令错误<请输入y/n!>!!!!!!"<<endl;
                        cout<<"数据录入成功,想继续录入吗(y/n)";
                        cin>>c;
                    }
                }while(c=='y');
                j++;
                cout<<"输入了 "<<amount<<"个学生的信息."<<endl;
                classs[a].num=amount;
            }
            /////////////////////////////////*显示学生数据*////////////////////////////////////////
            void show(student *head,int a)
            {
                int b;
                cout<<"|    学号   |   姓名   |  性别  |  年龄  |  成绩1 |  成绩2 |  成绩3 |  成绩4 |  成绩5 |  电话  |"<<endl;
                while(b!=classs[a].num)
                {
                    b++;
                    cout<<"| "<<setw(9)<<classs[a].per[b].ID;
                    cout<<" |  "<<setw(6)<<classs[a].per[b].name;
                    cout<<"  |  "<<setw(4)<<classs[a].per[b].sex;
                    cout<<"  |  "<<setw(4)<<classs[a].per[b].age;
                    cout<<"  |  "<<setw(4)<<classs[a].per[b].sc1;
                    cout<<"  |  "<<setw(4)<<classs[a].per[b].sc2;
                    cout<<"  |  "<<setw(4)<<classs[a].per[b].sc3;
                    cout<<"  |  "<<setw(4)<<classs[a].per[b]).sc4;
                    cout<<"  |  "<<setw(4)<<classs[a].per[b].sc5;
                    cout<<"  |  "<<setw(4)<<classs[a].per[b].call;
                    cout<<"  |  "<<endl;
                }
            }
            /////////////////////////////////*修改学生数据*////////////////////////////////////////
            void change(student *head,int a)
            {
                string name; char c; int b=0;
                do
                {
                    bool flag2=0;
                    cout<<"请输入您要修改的学生的姓名:";
                    cin>>name;
                    do
                    {
                        if(name==classs[a].per[b].name)
                        {
                            flag2=1;
                            cout<<"请输入新的成绩1):";
                            cin>>classs[a].per[b].sc1
                                cout<<"请输入新的成绩2:";
                            cin>>classs[a].per[b].sc2;
                            cout<<"请输入新的成绩3:";
                            cin>>classs[a].per[b].sc3;
                            cout<<"请输入新的成绩4:";
                            cin>>classs[a].per[b].sc4;
                            cout<<"请输入新的成绩5:";
                            cin>>classs[a].per[b].sc5;
                            cout<<"|    学号   |   姓名   |  性别  |  年龄  |  成绩1 |  成绩2 |  成绩3 |  成绩4 |  成绩5 |  电话  |"<<endl;
                            cout<<"| "<<setw(9)<<classs[a].per[b].ID;
                            cout<<" |  "<<setw(6)<<classs[a].per[b].name;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sex;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].age;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sc1;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sc2;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sc3;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sc4;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sc5;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].call;
                            cout<<"  |  "<<endl;
                            cout<<".......数据修改成功!\n";
                            break;
                        }
                        b++;
                    }while(b!=classs[a].num);
                    if(flag2==0)
                    {
                        cout<<"对不起!您要修改的学生不存在!请检查重新输入!!!!!!!"<<endl;
                    }
                    cout<<"想继续修改吗?(y/n)";
                    cin>>c;
                    if(c!='y'&&c!='n')
                    {
                        cout<<"指令错误!请重新输入<y/n>!!!!!!!";
                        cin>>c;
                    }
                }while(c=='y');
               
            }
            /////////////////////////////////*删除学生数据*////////////////////////////////////////
            void shanchu(student *head,int a)//学号
            {
                char c;string no; int b;
                do
                {
                    int flag=0;
                    cout<<"请输入你要删除的学生学号:";
                    cin>>no;
                    int b;
                    while(b!=classs[a].num&&classs[a].per[b].ID!=no)
                        b++;
                    if(b!=classs[a].snum)
                    {
                        flag=1;
                        classs[a].per[b]=classs[a].per[b+1];
                        classs[a].num=classs[a].num-1;
                        cout<<"......成功删除! ";
                    }
                    if(flag==0)
                        cout<<"对不起!您要删除的学生不存在!!!!!!!"<<endl;
                    cout<<"您想继续删除吗?(y/n)";
                    cin>>c;
                    while(c!='y'&&c!='n')
                    {
                        cout<<"指令错误<请输入y/n!>!!!!!!!"<<endl;
                        cout<<"您想继续删除吗?(y/n)";
                        cin>>c;
                    }
                }while(c=='y');
            }
            /////////////////////////////////*使用姓名查询学生数据*////////////////////////////////////////
            void search1(student *head,int a)//姓名查询
            {
                int b;
                char c;
                string name;
                do
                {
                    bool flag=0;
                    cout<<"请输入你要查询的学生姓名:";
                    cin>>name;
                    do{
                        if(b!=classs[a].num&&name==classs[a].per[b].name)    //输出总成绩
                        {
                            flag=1;
                            cout<<"您要查询的学生是:"<<name<<endl;
                            cout<<"|    学号   |   姓名   |  性别  |  年龄  |  成绩1 |  成绩2 |  成绩3 |  成绩4 |  成绩5 |  电话  |"<<endl;
                            cout<<"| "<<setw(9)<<classs[a].per[b].ID;
                            cout<<" |  "<<setw(6)<<classs[a].per[b].name;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sex;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].age;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sc1;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sc2;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sc3;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sc4;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sc5;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].call;
                            cout<<"  |  "<<endl;
                        }   
                        b=b+1;
                    }while(b!=classs[a].num);
                    if(flag==0)
                        cout<<"对不起!您要查询的学生不存在!!!!!!!"<<endl;
                    cout<<"您想继续查询吗?(y/n)";    cin>>c;
                    while(c!='y'&&c!='n')
                    {
                        cout<<"指令错误<请输入y/n!>!!!!!!!"<<endl;
                        cout<<"您想继续查询吗?(y/n)";    cin>>c;
                    }
                } while(c=='y');
            }

 
9 回复
#2
2010-12-11 21:58
程序代码:
    /////////////////////////////////*用学号查询学生数据*////////////////////////////////////////
            void search2(student *head,int a)//学号查询
            {
                char c;string no; int b;
                do
                {
                  
                    int flag=0;
                    cout<<"请输入你要查询的学生学号:";
                    cin>>no;
                    do
                    {
                        if(b!=classs[a].num&&no==classs[a].per[b].ID)
                        {
                            flag=1;
                            cout<<"您要查询的学生是:"<<classs[a].per[b].name<<endl;
                            cout<<"|    学号   |   姓名   |  性别  |  年龄  |  成绩1 |  成绩2 |  成绩3 |  成绩4 |  成绩5 |  电话  |"<<endl;
                            cout<<"| "<<setw(9)<<classs[a].per[b].ID;
                            cout<<" |  "<<setw(6)<<classs[a].per[b].name;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sex;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].age;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sc1;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sc2;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sc3;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sc4;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].sc5;
                            cout<<"  |  "<<setw(4)<<classs[a].per[b].call;
                            cout<<"  |  "<<endl;  
                        }
                        b=b+1;
                    }while(b!=classs[a].per[b].num);
                    if(flag==0)
                        cout<<"对不起!您要查询的学生不存在!!!!!!!"<<endl;
                    cout<<"您想继续查询吗?(y/n)";
                    cin>>c;
                    while(c!='y'&&c!='n')
                    {
                        cout<<"指令错误<请输入y/n!>!!!!!!!"<<endl;
                        cout<<"您想继续查询吗?(y/n)"<<endl;
                        cin>>c;
                    }  
                }while(c=='y');
            }
            /////////////////////////////////*保存学生数据*////////////////////////////////////////
            void readin1(student *head)     
            {   
                char c; int b;
               
                cout<<"现在保存输入学生数据,是否继续操作?(y/n)";
                cin>>c;
                ofstream  outfile("总评成绩1.txt",ios::out);
                if(! outfile)
                {
                    cout<<"打开文件错误!!!!!!!\n";
                    exit(0);
                }
                while(c!='n')
                {
                    while(b!=classs[a].per[b].num)
                    {    outfile<<"************************第"<<b<<"个学生的数据:*************************.\n";
                    outfile<<"|    学号   |   姓名   |  性别  |  年龄  |  成绩1 |  成绩2 |  成绩3 |  成绩4 |  成绩5 |  电话  |."<<endl;
                    outfile<<"| "<<setw(9)<<classs[a].per[b].ID<<" |  "<<setw(6)<<classs[a].per[b].name<<"  |  "<<setw(4)<<classs[a].per[b].sex<<
                        "  |  "<<setw(4)<<classs[a].per[b].age<<"  |  "<<setw(4)<<classs[a].per[b].sc1<<"  |  "<<setw(4)<<classs[a].per[b].sc2
                        <<"  |  "<<setw(4)<<classs[a].per[b].sc3<<"  |  "<<setw(4)<<classs[a].per[b].sc4<<"  |  "<<setw(4)<<classs[a].per[b].sc5<<"  |  "<<setw(4)<<(*stu).call<<endl;
                    b++;
                  
                    }
                    break;
                }
                cout<<"......成功将学生数据保存到<总评成绩1.txt>中! ";
                outfile.close();
            }
            void readin2(student *head)     
            {   
                char c; int b;
               
                cout<<"现在保存输入学生数据,是否继续操作?(y/n)";
                cin>>c;
                ofstream  outfile("总评成绩2.txt",ios::out);
                if(! outfile)
                {
                    cout<<"打开文件错误!!!!!!!\n";
                    exit(0);
                }
                while(c!='n')
                {
                    while(b!=classs[a].per[b].num)
                    {    outfile<<"************************第"<<b<<"个学生的数据:*************************.\n";
                    outfile<<"|    学号   |   姓名   |  性别  |  年龄  |  成绩1 |  成绩2 |  成绩3 |  成绩4 |  成绩5 |  电话  |."<<endl;
                    outfile<<"| "<<setw(9)<<classs[a].per[b].ID<<" |  "<<setw(6)<<classs[a].per[b].name<<"  |  "<<setw(4)<<classs[a].per[b].sex<<
                        "  |  "<<setw(4)<<classs[a].per[b].age<<"  |  "<<setw(4)<<classs[a].per[b].sc1<<"  |  "<<setw(4)<<classs[a].per[b].sc2
                        <<"  |  "<<setw(4)<<classs[a].per[b].sc3<<"  |  "<<setw(4)<<classs[a].per[b].sc4<<"  |  "<<setw(4)<<classs[a].per[b].sc5<<"  |  "<<setw(4)<<(*stu).call<<endl;
                    b++;
                  
                    }
                    break;
                }
                cout<<"......成功将学生数据保存到<总评成绩2.txt>中! ";
                outfile.close();
            } void readin3(student *head)     
            {   
                char c; int b;
               
                cout<<"现在保存输入学生数据,是否继续操作?(y/n)";
                cin>>c;
                ofstream  outfile("总评成绩3.txt",ios::out);
                if(! outfile)
                {
                    cout<<"打开文件错误!!!!!!!\n";
                    exit(0);
                }
                while(c!='n')
                {
                    while(b!=classs[a].per[b].num)
                    {    outfile<<"************************第"<<b<<"个学生的数据:*************************.\n";
                    outfile<<"|    学号   |   姓名   |  性别  |  年龄  |  成绩1 |  成绩2 |  成绩3 |  成绩4 |  成绩5 |  电话  |."<<endl;
                    outfile<<"| "<<setw(9)<<classs[a].per[b].ID<<" |  "<<setw(6)<<classs[a].per[b].name<<"  |  "<<setw(4)<<classs[a].per[b].sex<<
                        "  |  "<<setw(4)<<classs[a].per[b].age<<"  |  "<<setw(4)<<classs[a].per[b].sc1<<"  |  "<<setw(4)<<classs[a].per[b].sc2
                        <<"  |  "<<setw(4)<<classs[a].per[b].sc3<<"  |  "<<setw(4)<<classs[a].per[b].sc4<<"  |  "<<setw(4)<<classs[a].per[b].sc5<<"  |  "<<setw(4)<<(*stu).call<<endl;
                    b++;
                  
                    }
                    break;
                }
                cout<<"......成功将学生数据保存到<总评成绩3.txt>中! ";
                outfile.close();
            }
            void readin4(student *head)     
            {   
                char c; int b;
               
                cout<<"现在保存输入学生数据,是否继续操作?(y/n)";
                cin>>c;
                ofstream  outfile("总评成绩4.txt",ios::out);
                if(! outfile)
                {
                    cout<<"打开文件错误!!!!!!!\n";
                    exit(0);
                }
                while(c!='n')
                {
                    while(b!=classs[a].per[b].num)
                    {    outfile<<"************************第"<<b<<"个学生的数据:*************************.\n";
                    outfile<<"|    学号   |   姓名   |  性别  |  年龄  |  成绩1 |  成绩2 |  成绩3 |  成绩4 |  成绩5 |  电话  |."<<endl;
                    outfile<<"| "<<setw(9)<<classs[a].per[b].ID<<" |  "<<setw(6)<<classs[a].per[b].name<<"  |  "<<setw(4)<<classs[a].per[b].sex<<
                        "  |  "<<setw(4)<<classs[a].per[b].age<<"  |  "<<setw(4)<<classs[a].per[b].sc1<<"  |  "<<setw(4)<<classs[a].per[b].sc2
                        <<"  |  "<<setw(4)<<classs[a].per[b].sc3<<"  |  "<<setw(4)<<classs[a].per[b].sc4<<"  |  "<<setw(4)<<classs[a].per[b].sc5<<"  |  "<<setw(4)<<(*stu).call<<endl;
                    b++;
                  
                    }
                    break;
                }
                cout<<"......成功将学生数据保存到<总评成绩4.txt>中! ";
                outfile.close();
            }
            /////////////////////////////////*导入学生数据*////////////////////////////////////////
           
            void load1(int a)
            {
                char jank[999];
                fp=fopen("总评成绩1.txt","r");
                for(b=0;b<classs[a].num;b++)
                {
                    fscanf(fp,"%[^.].%c",jank,&jank);
                    fscanf(fp,"%[^.].%c",jank,&jank);
                    fsacnf(fp,"%[^|].%c",jank,&jank);
                    fscanf(fp,"%d",&classs[a].per[b].ID);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].name);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sex);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].age);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc1);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc2);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc3);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc4);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc5);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].call);
                }
            }
            void load2(int a)
            {
                char jank[999];
                fp=fopen("总评成绩2.txt","r");
                for(b=0;b<classs[a].num;b++)
                {
                    fscanf(fp,"%[^.].%c",jank,&jank);
                    fscanf(fp,"%[^.].%c",jank,&jank);
                    fsacnf(fp,"%[^|].%c",jank,&jank);
                    fscanf(fp,"%d",&classs[a].per[b].ID);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].name);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sex);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].age);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc1);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc2);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc3);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc4);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc5);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].call);
                }
            }
            void load3(int a)
            {
                char jank[999];
                fp=fopen("总评成绩3.txt","r");
                for(b=0;b<classs[a].num;b++)
                {
                    fscanf(fp,"%[^.].%c",jank,&jank);
                    fscanf(fp,"%[^.].%c",jank,&jank);
                    fsacnf(fp,"%[^|].%c",jank,&jank);
                    fscanf(fp,"%d",&classs[a].per[b].ID);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].name);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sex);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].age);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc1);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc2);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc3);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc4);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc5);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].call);
                }
            }
            void load4(int a)
            {
                char jank[999];
                fp=fopen("总评成绩4.txt","r");
                for(b=0;b<classs[a].num;b++)
                {
                    fscanf(fp,"%[^.].%c",jank,&jank);
                    fscanf(fp,"%[^.].%c",jank,&jank);
                    fsacnf(fp,"%[^|].%c",jank,&jank);
                    fscanf(fp,"%d",&classs[a].per[b].ID);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].name);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sex);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].age);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc1);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc2);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc3);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc4);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].sc5);
                    fscanf(fp,"%[^|].%c",jank,&jank);
                    fscang(fp,"%c",&classs[a].per[b].call);
                }
            }
            void teacher()/*验证码班级编号+8*/
            {
                cout<<"            ++++++++++**********++++++++++**********++++++++++\n";
                cout<<"            $                      菜  单                      $\n";
                cout<<"           $                     ^^^^^^^^^^                     $\n";   
                cout<<"          $          请选择:                                     $\n";
                cout<<"           $    [0]-学生登记;    [1]-学生修改;    [2]-导入     $\n";
                cout<<"            $   [3]-显示;        [4]-查询;        [5]-排序;   $\n";
                cout<<"             **********++++++++++**********++++++++++**********\n";
                cout<<" 请选择相应的数字进行操作: ";
                char x;
                do
                {
                    do
                    {
                        cin>>x;
                        if((x>='0'&&x<='9'))
                            flag2=1;
                        else
                        {
                            cout<<"指令错误!!!!!!!!!!"<<endl;
                            cout<<" 请选择相应的数字进行操作: ";
                        }
                    }while(flag2==0);
                    switch(x)
                    {
                    case'0':    {
                       
                        cout<<"******************************现在进行学生信息录入******************************\n";
                        input(head,v);
                        cout<<"输入的学生信息为:\n";
                        show(head,v);
                        cout<<"********************************************************************************\n";
                        teacher();break;
                                }
                       
                    case'1':    {
                       
                        cout<<"******************************现在进行学生信息修改******************************\n";
                       
                        change(head,a);
                        cout<<"********************************************************************************\n";
                        teacher();break;}
                    case'2':
                        {
                            cout<<"******************************现在进行学生信息导入******************************\n";
                            switch(v)
                            {case '1':load1(a);break;
                            case '2':load2(a);break;
                            case '3':load3(a);break;
                            case '4':load4(a);break;
                            }teacher();
                           
                            break;
                            case'3':{show(head,v);teacher();break;}
                            case'4':{
                                char z;
                                cout<<"******************************现在进行学生信息查询******************************\n";
                                cout<<"请选择查询方式:";
                                cout<<"(0).姓名查询;(1).学号查询:";  cin>>z;
                                while(z!='0'&&z!='1')
                                {
                                    cout<<"指令错误<请选择(0)或者(1)!>!!!!!!!"<<endl;
                                    cout<<"请选择查询方式:(0).姓名查询;(1).学号查询:"; cin>>z;      
                                }
                                switch(z)
                                {
                                case '0':search1(head,v);break;//按姓名查询
                                case '1':search2(head,v);break;//按学号查询
                                }   
                                cout<<"********************************************************************************\n";teacher();break;
                                case'5':break;
                                   
                                   
                                    }while(flag2==1);
                        }
                    }
                    void learn()/*验证码学号+5*/
                    {
                       
                        cout<<"            ++++++++++**********++++++++++**********++++++++++\n";
                        cout<<"            $                      菜  单                      $\n";
                        cout<<"           $                     ^^^^^^^^^^                     $\n";   
                        cout<<"          $          请选择:                                     $\n";
                        cout<<"            $                [0]-查询                           $\n";
                        cout<<"             **********++++++++++**********++++++++++**********\n";
                        cout<<" 请选择相应的数字进行操作: ";
                        char x;
                        do
                        {
                            do
                            {
                                cin>>x;
                                if((x==0))
                                    flag2=1;
                                else
                                {
                                    cout<<"指令错误!!!!!!!!!!"<<endl;
                                    cout<<" 请选择相应的数字进行操作: ";
                                }
                            }while(flag2==0);
                            switch(x)
                            {
                            case '0':show(head,v);student();break;
                            }
                        }
                        void go()
                        {
                            cout<<"            ++++++++++**********++++++++++**********++++++++++\n";
                            cout<<"            $                      菜  单                      $\n";
                            cout<<"           $                     ^^^^^^^^^^                     $\n";   
                            cout<<"          $          请选择你的操作:                             $\n";
                            cout<<"          $                      [0]-管理员                      $\n";
                            cout<<"           $                     [1]-老师                       $\n";
                            cout<<"            $                    [2]-学生                      $\n";
                            cout<<"             $                    [3]-退出                    $\n";
                           
                            cout<<"             **********++++++++++**********++++++++++**********\n";
                            cout<<" 请选择相应的数字进行操作: ";
                        }
                        void go1()/*管理员登入*/
                        {
                            int a,b;
                            cout<<"            ++++++++++**********++++++++++**********++++++++++\n";
                            cout<<"            $                      菜  单                      $\n";
                            cout<<"           $                     ^^^^^^^^^^                     $\n";   
                            cout<<"          $          请输入你的帐号:                             $\n";
                            cout<<"         $                 帐  号:"; scanf("%d",&a);cout<<"       $\n";
                            cout<<"         $                 验证码:";  scanf("%d",&b);
                            cout<<"                       $\n";
                            cout<<"             **********++++++++++**********++++++++++**********\n";
                            if(a==001&&b==0001)
                                gm();
                            else {
                                printf("帐号或验证码有误\n");
                                go();
                            };
                        }
                        void go2()/*老师登入*/
                        {
                            int a,b,i;
                            cout<<"            ++++++++++**********++++++++++**********++++++++++\n";
                            cout<<"            $                      菜  单                      $\n";
                            cout<<"           $                     ^^^^^^^^^^                     $\n";   
                            cout<<"          $          请输入你的帐号:                             $\n";
                            cout<<"         $                 班级编号:"; scanf("%d",&a);
                            cout<<"                       $\n";
                            cout<<"         $                 验证码:";  scanf("%d",&b);
                            cout<<"                       $\n";
                            cout<<"             **********++++++++++**********++++++++++**********\n";
                            for(i=0;i<4;i++)
                            {
                                if("b==a+8")
                                {
                                    teacher();
                                    v=a;
                                   
                                }
                                if("i>=4")printf("帐号或验证码有误\n");
                                go();
                            }
                        }
                        void go3()/*学生登入*/
                        {
                            int a,b,c,d,i;
                            cout<<"            ++++++++++**********++++++++++**********++++++++++\n";
                            cout<<"            $                      菜  单                      $\n";
                            cout<<"           $                     ^^^^^^^^^^                     $\n";   
                            cout<<"          $          请输入:                                     $\n";
                           
                            cout<<"         $                 班级编号:"; scanf("%d",&a);
                            cout<<"                       $\n";
                            cout<<"         $                 学  号:"; scanf("%d",&b);
                            cout<<"                       $\n";
                            cout<<"         $                 验证码:";  scanf("%d",&c);
                            cout<<"                       $\n";
                            cout<<"             **********++++++++++**********++++++++++**********\n";
                            for(i=0;i<50;i++)
                            {
                                if("b==classs[a].per[i].ID&&c=classs[a].per[i].yzm1")
                                    learn();
                                if("i>=4")printf("帐号或验证码或班级编号有误\n");
                                go();
                                else break;
                            }
                        }
                       
                        
#3
2010-12-11 21:59
问题主要出在主函数
程序代码:
--------------------Configuration: 5555 - Win32 Debug--------------------
Compiling...
5555.cpp
i:\5555.cpp(78) : error C2065: 'head' : undeclared identifier
i:\5555.cpp(78) : error C2296: '*' : illegal, left operand has type 'void (__cdecl *)(void)'
i:\5555.cpp(78) : error C2061: syntax error : identifier 'student'
i:\5555.cpp(79) : error C2227: left of '->next' must point to class/struct/union
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2059: syntax error : ';'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : error C2143: syntax error : missing ';' before '{'
i:\5555.cpp(83) : fatal error C1003: error count exceeds 100; stopping compilation
Error executing cl.exe.

5555.obj - 102 error(s), 0 warning(s)

#4
vandychan2010-12-11 22:03
确实很长
#5
laoyang1032010-12-11 22:04
只有本站会员才能查看附件,请 登录

有那么复杂嘛????????????????
写了这么多   102个错误
你可以参考一下我写的这个
#6
2010-12-11 22:15
回复 5楼 laoyang103
大部分都是同一个错误。。函数单个编译都没问题,就是放在一起主函数就出问题了。。
#7
2010-12-11 23:06
没人解答么。。。。
#8
樵头2010-12-11 23:28
哥哥你这个没法改,你还是重写吧,用工程来写
1>------ Build started: Project: luntan, Configuration: Debug Win32 ------
1>Compiling...
1>first.cpp
1>f:\mypro\c ++thinking\luntan\first.cpp(80) : error C2061: syntax error : identifier 'student'
1>f:\mypro\c ++thinking\luntan\first.cpp(222) : error C2296: '*' : illegal, left operand has type 'void (__cdecl *)(void)'
1>f:\mypro\c ++thinking\luntan\first.cpp(222) : error C2297: '*' : illegal, right operand has type 'student *'
1>f:\mypro\c ++thinking\luntan\first.cpp(222) : error C2062: type 'int' unexpected
1>f:\mypro\c ++thinking\luntan\first.cpp(223) : error C2143: syntax error : missing ';' before '{'
1>f:\mypro\c ++thinking\luntan\first.cpp(237) : error C2065: 'p' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(241) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(241) : error C2061: syntax error : identifier 'student'
1>f:\mypro\c ++thinking\luntan\first.cpp(242) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(242) : error C2228: left of '.ID' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(243) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(243) : error C2228: left of '.name' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(244) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(244) : error C2228: left of '.sex' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(245) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(245) : error C2228: left of '.age' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(246) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(246) : error C2228: left of '.call' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(247) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(247) : error C2228: left of '.sc1' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(248) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(248) : error C2228: left of '.sc2' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(249) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(249) : error C2228: left of '.sc3' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(250) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(250) : error C2228: left of '.sc4' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(251) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(251) : error C2228: left of '.sc5' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(252) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(252) : error C2228: left of '.ID' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(253) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(253) : error C2228: left of '.name' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(254) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(254) : error C2228: left of '.sex' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(255) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(255) : error C2228: left of '.age' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(256) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(256) : error C2228: left of '.call' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(257) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(257) : error C2228: left of '.sc1' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(258) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(258) : error C2228: left of '.sc2' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(259) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(259) : error C2228: left of '.sc3' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(260) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(260) : error C2228: left of '.sc4' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(261) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(261) : error C2228: left of '.sc5' must have class/struct/union
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(263) : warning C4091: '' : ignored on left of '<unnamed-type-classs> [4]' when no variable is declared
1>f:\mypro\c ++thinking\luntan\first.cpp(263) : error C2143: syntax error : missing ';' before '['
1>f:\mypro\c ++thinking\luntan\first.cpp(263) : error C2337: 'a' : attribute not found
1>f:\mypro\c ++thinking\luntan\first.cpp(263) : error C2143: syntax error : missing ';' before '.'
1>f:\mypro\c ++thinking\luntan\first.cpp(264) : warning C4091: '' : ignored on left of '<unnamed-type-classs> [4]' when no variable is declared
1>f:\mypro\c ++thinking\luntan\first.cpp(264) : error C2143: syntax error : missing ';' before '['
1>f:\mypro\c ++thinking\luntan\first.cpp(264) : error C2337: 'a' : attribute not found
1>f:\mypro\c ++thinking\luntan\first.cpp(264) : error C2143: syntax error : missing ';' before '.'
1>f:\mypro\c ++thinking\luntan\first.cpp(265) : warning C4091: '' : ignored on left of '<unnamed-type-classs> [4]' when no variable is declared
1>f:\mypro\c ++thinking\luntan\first.cpp(265) : error C2143: syntax error : missing ';' before '['
1>f:\mypro\c ++thinking\luntan\first.cpp(265) : error C2337: 'a' : attribute not found
1>f:\mypro\c ++thinking\luntan\first.cpp(265) : error C2143: syntax error : missing ';' before '.'
1>f:\mypro\c ++thinking\luntan\first.cpp(266) : warning C4091: '' : ignored on left of '<unnamed-type-classs> [4]' when no variable is declared
1>f:\mypro\c ++thinking\luntan\first.cpp(266) : error C2143: syntax error : missing ';' before '['
1>f:\mypro\c ++thinking\luntan\first.cpp(266) : error C2337: 'a' : attribute not found
1>f:\mypro\c ++thinking\luntan\first.cpp(266) : error C2143: syntax error : missing ';' before '.'
1>f:\mypro\c ++thinking\luntan\first.cpp(267) : warning C4091: '' : ignored on left of '<unnamed-type-classs> [4]' when no variable is declared
1>f:\mypro\c ++thinking\luntan\first.cpp(267) : error C2143: syntax error : missing ';' before '['
1>f:\mypro\c ++thinking\luntan\first.cpp(267) : error C2337: 'a' : attribute not found
1>f:\mypro\c ++thinking\luntan\first.cpp(267) : error C2143: syntax error : missing ';' before '.'
1>f:\mypro\c ++thinking\luntan\first.cpp(268) : warning C4091: '' : ignored on left of '<unnamed-type-classs> [4]' when no variable is declared
1>f:\mypro\c ++thinking\luntan\first.cpp(268) : error C2143: syntax error : missing ';' before '['
1>f:\mypro\c ++thinking\luntan\first.cpp(268) : error C2337: 'a' : attribute not found
1>f:\mypro\c ++thinking\luntan\first.cpp(268) : error C2143: syntax error : missing ';' before '.'
1>f:\mypro\c ++thinking\luntan\first.cpp(269) : warning C4091: '' : ignored on left of '<unnamed-type-classs> [4]' when no variable is declared
1>f:\mypro\c ++thinking\luntan\first.cpp(269) : error C2143: syntax error : missing ';' before '['
1>f:\mypro\c ++thinking\luntan\first.cpp(269) : error C2337: 'a' : attribute not found
1>f:\mypro\c ++thinking\luntan\first.cpp(269) : error C2143: syntax error : missing ';' before '.'
1>f:\mypro\c ++thinking\luntan\first.cpp(270) : warning C4091: '' : ignored on left of '<unnamed-type-classs> [4]' when no variable is declared
1>f:\mypro\c ++thinking\luntan\first.cpp(270) : error C2143: syntax error : missing ';' before '['
1>f:\mypro\c ++thinking\luntan\first.cpp(270) : error C2337: 'a' : attribute not found
1>f:\mypro\c ++thinking\luntan\first.cpp(270) : error C2143: syntax error : missing ';' before '.'
1>f:\mypro\c ++thinking\luntan\first.cpp(271) : warning C4091: '' : ignored on left of '<unnamed-type-classs> [4]' when no variable is declared
1>f:\mypro\c ++thinking\luntan\first.cpp(271) : error C2143: syntax error : missing ';' before '['
1>f:\mypro\c ++thinking\luntan\first.cpp(271) : error C2337: 'a' : attribute not found
1>f:\mypro\c ++thinking\luntan\first.cpp(271) : error C2143: syntax error : missing ';' before '.'
1>f:\mypro\c ++thinking\luntan\first.cpp(272) : warning C4091: '' : ignored on left of '<unnamed-type-classs> [4]' when no variable is declared
1>f:\mypro\c ++thinking\luntan\first.cpp(272) : error C2143: syntax error : missing ';' before '['
1>f:\mypro\c ++thinking\luntan\first.cpp(272) : error C2337: 'a' : attribute not found
1>f:\mypro\c ++thinking\luntan\first.cpp(272) : error C2143: syntax error : missing ';' before '.'
1>f:\mypro\c ++thinking\luntan\first.cpp(273) : warning C4091: '' : ignored on left of '<unnamed-type-classs> [4]' when no variable is declared
1>f:\mypro\c ++thinking\luntan\first.cpp(273) : error C2143: syntax error : missing ';' before '['
1>f:\mypro\c ++thinking\luntan\first.cpp(273) : error C2337: 'a' : attribute not found
1>f:\mypro\c ++thinking\luntan\first.cpp(273) : error C2143: syntax error : missing ';' before '.'
1>f:\mypro\c ++thinking\luntan\first.cpp(274) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(274) : error C2227: left of '->next' must point to class/struct/union/generic type
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(274) : error C2065: 'p' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(274) : error C2227: left of '->next' must point to class/struct/union/generic type
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(275) : error C2065: 'p' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(275) : error C2227: left of '->next' must point to class/struct/union/generic type
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(275) : error C2065: 'stu' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(278) : error C2065: 'p' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(278) : error C2065: 'p' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(278) : error C2227: left of '->next' must point to class/struct/union/generic type
1>        type is ''unknown-type''
1>f:\mypro\c ++thinking\luntan\first.cpp(288) : warning C4091: '' : ignored on left of '<unnamed-type-classs> [4]' when no variable is declared
1>f:\mypro\c ++thinking\luntan\first.cpp(288) : error C2143: syntax error : missing ';' before '['
1>f:\mypro\c ++thinking\luntan\first.cpp(288) : error C2337: 'a' : attribute not found
1>f:\mypro\c ++thinking\luntan\first.cpp(288) : error C2143: syntax error : missing ';' before '.'
1>f:\mypro\c ++thinking\luntan\first.cpp(291) : error C2296: '*' : illegal, left operand has type 'void (__cdecl *)(void)'
1>f:\mypro\c ++thinking\luntan\first.cpp(291) : error C2297: '*' : illegal, right operand has type 'student *'
1>f:\mypro\c ++thinking\luntan\first.cpp(291) : error C2062: type 'int' unexpected
1>f:\mypro\c ++thinking\luntan\first.cpp(292) : error C2143: syntax error : missing ';' before '{'
1>f:\mypro\c ++thinking\luntan\first.cpp(295) : error C2065: 'a' : undeclared identifier
1>f:\mypro\c ++thinking\luntan\first.cpp(295) : error C2275: 'classs' : illegal use of this type as an expression
1>        f:\mypro\c ++thinking\luntan\first.cpp(49) : see declaration of 'classs'
1>f:\mypro\c ++thinking\luntan\first.cpp(295) : error C2228: left of '.num' must have class/struct/union
1>f:\mypro\c ++thinking\luntan\first.cpp(295) : fatal error C1003: error count exceeds 100; stopping compilation
1>Build log was saved at "file://f:\MYpRO\C ++thinking\luntan\Debug\BuildLog.htm"
1>luntan - 102 error(s), 12 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
#9
laoyang1032010-12-12 09:38
不是我不想帮你改   你实在是写的太多了   
你可以自己一个一个类的改   不要这样把那么多代码粘到帖子上
没人愿意看的
#10
yuyouchun2010-12-14 21:31
同意楼上的看法!!
1