求在C语言的代码中加个排序函数

来源:百度知道 编辑:UC知道 时间:2024/06/16 03:33:54
按学号排序的,代码太长了发不上来,谁帮我写下我把代码发给他.

都搞好了。
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

#define LEN 30 /* 学号和姓名最大字符数,实际请更改 */
#define N 200 /* 最大学生人数,实际请更改*/

struct record
{
char code[LEN+1]; /* 学号 */
char name[LEN+1]; /* 姓名 */
int age;
char sex[3];
char time[LEN+1];
char add[LEN+1];
char tel[LEN+1];
char mail[LEN+1];
}stu[N];
int k=1,n,m;
int order[N];

void readfile();/* 函数声明 */
void sort();
void seek();
void modify();
void insert();
void del();
void display();
void save();
void menu();

int main()
{
while(k)
menu();
system("pause");
return 0;
}

void readfile()/* 建立信息 */
{
char *p="student.dat";
FILE *fp;
int i=0;
if ((fp=fopen(