Abstract Data Types in C
- Interface declares operations, not data structure
- Implementation is hidden from client (encapsulation)
- Use features of programming language to ensure encapsulation
Common practice
- Allocation and deallocation of data structure handled by module
- Names of functions and variables begin with <modulename>_
- Provide as much generality/flexibility in interface as possible
- Use void pointers to allow polymorphism
#ifndef ARRAY_H
#define ARRAY_H
typedef struct Array *Array_T;
extern Array_T Array_new(void);
extern void Array_free(Array_T array);
extern void Array_insert(Array_T array, void *datap);
extern void Array_remove(Array_T array, void *datap);
Abstract Data Types in C的更多相关文章
- ADT(abstract data types)抽象数据类型
1.What is it? An abstract data type is a set of objects together with a set of operations. 抽象数据类型是带有 ...
- Core Java Volume I — 3.3. Data Types
3.3. Data TypesJava is a strongly typed language(强类型语音). This means that every variable must have a ...
- C and SQL data types for ODBC and CLI
C and SQL data types for ODBC and CLI This topic lists the C and SQL data types for ODBC and CLI a ...
- allow zero datetime=true导致datetime转换失败:MySql.Data.Types.MySqlDateTime”的对象无法转换为类型“System.Nullable`1[System.DateTime]
allow zero datetime=true导致datetime转换失败:MySql.Data.Types.MySqlDateTime”的对象无法转换为类型“System.Nullable`1[S ...
- "SQL Server does not handle comparison of NText, Text, Xml, or Image data types."
"SQL Server does not handle comparison of NText, Text, Xml, or Image data types." sql2000 ...
- ExtJS笔记 Ext.data.Types
This is a static class containing the system-supplied data types which may be given to a Field. Type ...
- Entity Framework Code First (七)空间数据类型 Spatial Data Types
声明:本文针对 EF5+, Visual Studio 2012+ 空间数据类型(Spatial Data Types)是在 EF5 中引入的,空间数据类型表现有两种: Geography (地理学上 ...
- Delphi Data Types
http://docwiki.embarcadero.com/RADStudio/XE6/en/Delphi_Data_Types Integer Data Types Type Descriptio ...
- MongoDB - The mongo Shell, Data Types in the mongo Shell
MongoDB BSON provides support for additional data types than JSON. Drivers provide native support fo ...
随机推荐
- 异步IO(协程,消息循环队列)
同步是CPU自己主动查看IO操作是否完成,异步是IO操作完成后发出信号通知CPU(CPU是被通知的) 阻塞与非阻塞的区别在于发起IO操作之后,CPU是等待IO操作完成再进行下一步操作,还是不等待去做其 ...
- Linux 最小安装常用包
Linux最小安装后很多常用的工具都没有,但直接通过yum install 文件名的方式可能无法找到,汇总于此,随时更新: CentOS7 1.如果要通过SecureCRT上直接上传下载文件,最简单的 ...
- 开发框架DevExtreme全新发布v18.2.6|附下载
DevExtreme Complete Subscription是性能最优的 HTML5,CSS 和 JavaScript 移动.Web开发框架,可以直接在Visual Studio集成开发环境,构建 ...
- 源码安装nginx 出现fatal error: pcre.h: 没有此文件或者目录
原因是用了pcre2 重新下载pcre再编译即可.
- L268 A terrifying look at the consequences of climate change
Climate change is a devilish problem for humanity: at once urgent and slow-moving, immediate and dis ...
- Python 基础的应用day2
1 用户交互input,将用户输入的内容赋值给 name 变量 后只能是字符串str. 区别2和3: ps :python2:raw_input python3:input 例 :1 nam ...
- C:基础知识
基础知识 一.基础转义字符 1.常用的转义字符 \n 回车换行 (10) \” 双引号 \t 横向跳格(9) \0 空字符(0) \v 竖向跳格 (11) \a 响铃(7) \b 退格 (8) \ ...
- python3自学第二天,模块,三元运算
1.模块的认识. sys模块,os模块等 如何引入模块 import os cmd_res1=os.system("dir") # 执行命令dir,不保存结果 print(cmd_ ...
- os.path和sys.path的区别
os.path是module,包含了各种处理长文件名(路径名)的函数. sys.path是由目录名构成的列表,python从中查找扩展模块(python源模块)编译模块,或者二进制扩展),启动pyth ...
- django做redis缓存
django中应用redis:pip3 install django-redis - 配置 CACHES = { "default": { "BACKEND": ...