编写一个程序采用表头插入或表尾插入的方法建立一个10个学生的链表

[复制链接]
查看11 | 回复2 | 2011-10-18 10:13:57 | 显示全部楼层 |阅读模式
STUDENT *create(){ int i; int s; STUDENT *h=NULL,*info;/* STUDENT指向结构体的指针*/ for(;;) {
info=(STUDENT *)malloc(sizeof(STUDENT));/*申请空间*/
if(!info) /*如果指针info为空*/
{ printf("\nout of memory"); /*输出内存溢出*/ return NULL;
/*返回空指针*/
}
inputs("enter no:",info->no,...
回复

使用道具 举报

千问 | 2011-10-18 10:13:57 | 显示全部楼层
这个程序里稍微用了点c++的内容,其他基本上和题目要求的是一致的。#include #include using namespace std;structstudent{int num;string name;float score;student *next;...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行