在vc6编译代码时出现error C2120: 'void' illegal with all types,请教大神该怎么改?

#include<stdio.h>                            //头文件的开始

#include<stdlib.h>

struct Student1                                //学生结构体

{

      long int number;

      char name[15],sex[5];

      int age;

      float score[4];

      double total;

      double averge;

};

struct Student                                  //结点结构体

{

    struct Student1 stu;

      struct Student *next;

};

void Caidan(struct Student *p);                     //菜单函数

int print();                                      //主菜单输出函数

void Input(struct Student *p);                      //数据输入函数

void Insert(struct Student *p);                      //插入函数

void Sort(struct Student *p);                       //排序总函数

void Sort1(struct Student *p);                      //学号排序函数

void Sort2(struct Student *p);                      //成绩排序函数

void Find(struct Student *p);                      //查找函数

void Delet(struct Student *p);                      //删除函数

void Display(struct Student *p);                    //从函数中读取输出函数

void Display1(struct Student *p);                   //输出函数

void out();                                     //退出函数

void Write(struct Student *,char s[]);                //写函数

void Read(struct Student *,char s[]);                //读函授

/*主函数开始*/

int main()

{   struct Student *p=NULL;                     //定义结点指针             

      for(;;)                                     //死循环控制菜单

             Caidan(p);

      return 0;

}                                            //主函数结束

void Caidan(struct Student *p)          //菜单函数

{  int n;

      n=print();                                  //调用菜单输出函数

      switch(n)                                  //用switch做菜单选择

      {

      case 1: Input(p);break;                       //输入1调用Input函数

      case 2:Insert(p);break;                       //输入2调用Insert函数

      case 3: Sort(p);break;                        //输入3调用Sort函数

      case 4:Find(p);break;                        //输入4调用Find函数

      case 5:Delet(p);break;                       //输入5调用Delet函数

      case 6:Display(p);break;                     //输入6调用Display函数

      case 7:out();break;                          //输入7调用Out函数

      }

}                                          //菜单函数结束                                                                           

int print()                                    //菜单输出函数

{

      int n;

      printf("********************目录**********************\n");

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值