11 2008 档案

《C++编程——数据结构与程序设计方法》程序范例:影碟店(源代码)
摘要:《C++编程——数据结构与程序设计方法》中的程序范例:影碟店。找不到附书光盘(有的能送个吗?),自己根据电子书调试通过的。可做为模板、链表及相关程序设计的参考。放到我上传的资源里了,需要的可到那里下载 阅读全文

posted @ 2008-11-09 16:51 WestGarden 阅读(214) 评论(0) 推荐(0) 编辑

模板——链表模板、有序链表模板及测试
摘要://==============================================================================//链表模板《C++编程——数据结构与程序设计方法》16.2作为抽象数据类型的链表//Header File:linkedList.h#ifndef _LINKEDLIST_H#define _LINKEDLIST_Htemplate<class Type>struct nodeType{Type info;nodeType<Type>* link;};template<class Type>clas 阅读全文

posted @ 2008-11-08 17:18 WestGarden 阅读(374) 评论(0) 推荐(0) 编辑

模板——类模板
摘要://《C++编程——数据结构与程序设计方法》15.8.3#include<iostream>#include <string>#include "arrayListType.h"using namespace std;template<class elemType>arrayListType<elemType>::arrayListType(int size)//(int size=100)是错的??{if(size<0){cout<<"Thearray size must be positive 阅读全文

posted @ 2008-11-08 02:49 WestGarden 阅读(170) 评论(0) 推荐(0) 编辑

模板——函数模板
摘要://《C++编程——数据结构与程序设计方法》例15.8//利用函数重载技术,求两个整数、字符、浮点数或字符串中的较大值,需要编写4个函数larger。//而C++通过提供函数模板,简化了重载函数据的过程。#include <iostream>using namespace std;template<class Type>//Type,模板的形参,用于确定函数的形参,返回值类型,还用于在函数中声明变量。Type larger(Type x,Type y);int main(){cout<<"Line 1: Larger of 5 and 6 =&qu 阅读全文

posted @ 2008-11-08 00:12 WestGarden 阅读(136) 评论(0) 推荐(0) 编辑

导航

统计

点击右上角即可分享
微信分享提示