2012年12月17日

C++创建动态链表并显示

摘要: #include <IOSTREAM>using namespace std;class book//定义书籍类{public: int num;//书籍编号 float price;//书籍价格 book*next;//指向书籍类的指针};book *head=NULL;//头结点指针,初始化为空/******************************* 函数声明区*******************************/book *creat_dynamic_link();void show_book(book *head);/***************... 阅读全文

posted @ 2012-12-17 19:13 Jerold 阅读(837) 评论(0) 推荐(0)

结构体链表

摘要: #include <IOSTREAM>using namespace std;struct book //class{ int num; float price; struct book*next;//type+type_name+pointer};int main(){ book x,y,z,*head,*p; x.num=10000; x.price=14.5; y.num=15000; y.price=15.5; z.num=20000; z.price=16.5; head=&x;//define x the head node x.next=&y; y.n 阅读全文

posted @ 2012-12-17 16:04 Jerold 阅读(123) 评论(0) 推荐(0)

导航