/*************************************************************************
> File Name: singleLineTable.c
> Author: zshh0604
> Mail: zshh0604@.com
> Created Time: 2014年10月15日 星期三 11时34分08秒
************************************************************************/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
/***
* 循环单链表。
*
* 学生结构体:
* id: 学生编号
* name:学生姓名
* math:分数
* next:指向下一个学生结构体
*/
typedef struct student {
int id;
char name[20];
int math;
struct student * next;
}stu;
typedef int cmp_stu(const void * ,const void *);
/****
* 函数功能:
* 创建一个头节点。
* 函数參数:
* void.
* 函数的返回值:
* 返回头节点指针。
*/
stu * create(void)
{
stu *head = NULL;
stu *p = NULL;
stu *new = NULL;
int tmpId = 0 ;
char tmpName[20];
int tmpMath;
head =(stu*) malloc(sizeof(stu));
if(head == NULL)
{
printf("分配stu地址空间失败!。。
");
return NULL;
}
head->id = 0;
strncpy(head->name,"