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 ...
随机推荐
- debian系统下安装ssh
SSH 为 Secure Shell 的缩写,SSH 为建立在应用层基础上的安全协议.SSH 是目前较可靠,专为远程登录会话和其他网络服务提供安全性的协议.利用 SSH 协议可以有效防止远程管理过程中 ...
- [Leetcode 3] 最长不重复子串 Longest substring without repeating 滑动窗口
[题目] Given a string, find the length of the longest substring without repeating characters. [举例] Exa ...
- ubuntu14.04下搜狗输入法不能输入中文问题解决
解决方法如下: 一.重启搜狗输入法 通过下面的两个命令重启搜狗输入法 ~$ killall fcitx ~$ killall sogou-qinpanel 二.检查修复安装依赖 ~$ sud ...
- elk之elasticsearch安装
环境: centos7 jdk8 参考: https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.htmlhttp:// ...
- redis 五大数据类型之list篇
1.lpush/lpop/rpop/rpush/lrange 这里的list就是链表,lpush就是从左往右插入数据,rpush就是从右往左插数据,lrange就是从左往右范围性的取值,pop就是弹 ...
- vue中七牛插件使用
<template> <div id="cxUpload" class="cx-upload"> <button id=" ...
- PCMU G.711U/PCMA G.711A简介
PCMA(G.711A) 类型:Audio 制定者:ITU-T 所需频宽:64Kbps(90.4) 特性:PCMU和PCMA都能提供较好的语音质量,但是它们占用的带宽较高,需要64kbps. 优点:语 ...
- 地理空间数据云--TM影像下载
实验要用到遥感影像,,TM,,之前是可以在美国USGS上下载的,但是要FQ了,有点麻烦,, 想到之前本科实在地理空间数据云平台下载的,就试了一下以前的账号,完美!,, TM数据很丰富,到2017年的都 ...
- 基于链路的OSPF简单口令认证
实验要求:掌握基于链路的OSPF简单口令认证 拓扑如下: 配置如下: R1enable configure terminal interface s0/0/0ip address 192.168.1. ...
- USB抓包工具Bus Hound
/********************************************************************** * USB抓包工具Bus Hound * 说明: * 之 ...