第10部分创建功能更强的类型说课讲解.ppt

第10章 创建功能更强的类型;从面向过程到面向对象;抽象的过程;面向对象的程序设计 ;从面向过程到面向对象;面向对象的程序设计的特点 ;面向对象的程序设计的特点;面向对象的程序设计的特点;从面向过程到面向对象;库和类 ;库的设计;Array库的头文件;//根据low和high为数组分配空间 bool initialize(DoubleArray arr, int low, int high); //设置数组元素的值 bool insert(const DoubleArray arr, int index, double value); //取数组元素的值 bool fatch(const DoubleArray arr, int index, double value); //回收数组空间 void cleanup(const DoubleArray arr); #endif ;Array库的实现文件;bool insert(const DoubleArray arr, int index, double value) { if (index arr.low || index arr.high) return false; arr.storage[index - arr.low] = value; return true; } bool fatch(const D

文档评论(0)

1亿VIP精品文档

相关文档