• 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的更多相关文章

  1. ADT(abstract data types)抽象数据类型

    1.What is it? An abstract data type is a set of objects together with a set of operations. 抽象数据类型是带有 ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. "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 ...

  6. ExtJS笔记 Ext.data.Types

    This is a static class containing the system-supplied data types which may be given to a Field. Type ...

  7. Entity Framework Code First (七)空间数据类型 Spatial Data Types

    声明:本文针对 EF5+, Visual Studio 2012+ 空间数据类型(Spatial Data Types)是在 EF5 中引入的,空间数据类型表现有两种: Geography (地理学上 ...

  8. Delphi Data Types

    http://docwiki.embarcadero.com/RADStudio/XE6/en/Delphi_Data_Types Integer Data Types Type Descriptio ...

  9. 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 ...

随机推荐

  1. Dell灵越 5559笔记本安装固态硬盘 BIOS设置

    固态硬盘的安装这里就不详细说明了,安装一共有两种 直接把原有的磁盘卸了,换成SSD(这种方法最简单) 另一种是把光驱卸掉,然后换上SSD(这里建议把原来的磁盘换到光驱里面,把SSD加到原来磁盘安装的位 ...

  2. VSTO:使用C#开发Excel、Word【1】

    <Visual Studio Tools for Office: Using C# with Excel, Word, Outlook, and InfoPath >——By Eric C ...

  3. NioEventLoop中的thread什么时候启动

    在构造函数中被赋值,并传入传入runnable接口,方法里面循环select,然后处理找到的key 但是这个thread是什么时候被start的呢? 在bootstrap bind的逻辑里,后半部分是 ...

  4. <Spark><Introduction to Spark>

    What Is Apache Spark? 速度方面:Spark扩展了MapReduce模型,可以更高效地提供多种类型的计算,包括交互式查询和流处理.Spark为speed所提供的最大能力就是内存计算 ...

  5. ESP8266上报数据到中国移动物联网平台HTTP

    #include <HttpPacket.h> #include <ArduinoJson.h> #include <ESP8266WiFi.h> HttpPack ...

  6. python map 常见用法

    python map 常见用法2017年02月01日 19:32:41 淇怪君 阅读数:548版权声明:欢迎转载,转载请注明出处 https://blog.csdn.net/Tifficial/art ...

  7. 关于方法中的self参数和全局变

    先摆样例程序,自己想想执行结果是怎样的:如果注释掉global va后,执行的结果又会如何?同时注释掉global va和va = [value]+va两行呢? #a.py va = ['va1',' ...

  8. nodejs环境下配置运行mysql

    首先需要在本地运行node环境   必须在本地安装mysql(可以用xampp里面的) 在node环境下引入mysql模块   命令: npm install node-mysql 运用例子(前提条件 ...

  9. 2.10 select下拉框

    2.10 select下拉框 本篇以百度设置下拉选项框为案例,详细介绍select下拉框相关的操作方法. 一.认识select    1.打开百度-设置-搜索设置界面,如下图所示 2.箭头所指位置,就 ...

  10. BT原理分析

    BT全名為BitTorrent,是一個p2p軟件,你在下載download的同時,也在為其他用戶提供上傳upload,因為大家是「互相幫助」,所以不會隨著用戶數的增加而降低下載速度. 其實跟ED也十分 ...