What is an object?    (Page 238)

In C++, an object is just a variable, and the purest definition is "a region of storage" (this is a more specific way of saying, "an object must have a unique identifier," which  in the case of C++ is an unique memory address). It's a place where you can store data, and it's implied that there are also operations that can be performed on this data.

Empty structure in C++    (Page 241)

In C, the empty structure is illegal, but in C++ we need the option of creating a struct whose sole task is to scope function names, so it is allowed. So structures with no data members will always have some minimum nonzero size.

Header file etiquette

What you can put into header file.    (Page 244-245)

The basic rule is "only declarations," that is, only information to the compiler but nothing that allocates storage by generating code or createing variables.

The second header-file issue is this: when you put a struct declaration in a header file, it is possible for the file to be included more than once in a complicated program. Both C and C++ allow you to redeclare a function, as long as the two declarations match, but neither will allow the redeclaration of a structure. We can use the preprocessor directives "#define #ifdef #endif" to solve the problem.

Global scope resolution    (Page 253)

::

If you want use a global variable in a function, but there is a same named variable in the function. The compiler would default to choosing the local one. So you can specify a global name using scope resolution "::".

Data Abstraction的更多相关文章

  1. 1.2 Data Abstraction(算法 Algorithms 第4版)

    1.2.1 package com.qiusongde; import edu.princeton.cs.algs4.Point2D; import edu.princeton.cs.algs4.St ...

  2. Clean Code – Chapter 6 Objects and Data Structures

    Data Abstraction Hiding implementation Data/Object Anti-Symmetry Objects hide their data behind abst ...

  3. three levels of abstraction

    DATABASESYSTEM CONCEPTS SIXTH EDITION Abraham Silberschatz Yale University Henry F. KorthLehigh Univ ...

  4. Objective-C Data Encapsulation

    All Objective-C programs are composed of the following two fundamental elements: Program statements ...

  5. 设计模式之里氏代换原则(LSP)

    里氏代换原则(Liskov Substitution Principle, LSP) 1 什么是里氏代换原则 里氏代换原则是由麻省理工学院(MIT)计算机科学实验室的Liskov女士,在1987年的O ...

  6. 深入Java核心 Java中多态的实现机制(1)

    在疯狂java中,多态是这样解释的: 多态:相同类型的变量,调用同一个方法时,呈现出多中不同的行为特征, 这就是多态. 加上下面的解释:(多态四小类:强制的,重载的,参数的和包含的) 同时, 还用人这 ...

  7. 【DB】database introduction

    database applications: – Banking System,– Stock Market,– Transportation,– Social Network,– Marine Da ...

  8. Expression Tree Basics 表达式树原理

    variable point to code variable expression tree data structure lamda expression anonymous function 原 ...

  9. 代码规范、GitHub提交源码的标准 答题人-杨宇杰

    1.格式与命名规范1.1 缩进 使用Tab缩进,而不是空格键1.2 换行 每行120字符 if,for,while语句只有单句时,如果该句可能引起阅读混淆,需要用" {"和&quo ...

随机推荐

  1. [转载]tcp可靠性的好文

    TCP是通过什么方式来提供可靠传输的 2012-11-23 14:18 665人阅读 评论(0) 收藏 举报 TCP是通过什么方式来提供可靠传输的 (合理截断数据包,超时重发,校验,失序重新排序,能够 ...

  2. HW4.13

    public class Solution { public static void main(String[] args) { int n = 0; while(n * n * n < 120 ...

  3. Asp.Net Design Pattern Studynotes -- Part1

    Asp.Net Design Pattern Studynotes -- Part1 let's start with an exampleto entry amazing OO world ! le ...

  4. dp hdu-4433 locker

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4433 题目大意: 给两个长度相等的数字串s1,s2.每次操作可以把连续的最多三位都+1或-1,如果超 ...

  5. jmeter控制器

    1.仅一次控制器  这个控制器可以保证线程在多次循环跑得情况下只登陆一次 2.循环控制器(Loop Controller:设置循环次数 结果: 3. ForEach控制器(ForEach Contro ...

  6. uva 1030 - Image Is Everything(迭代更新)

    题目链接:uva 1030 - Image Is Everything 题目大意:有一个最大为n*n*n的立方体的一个不规整立体,由若干个1*1*1的小正方体构成(每一个小正方体被涂成不同的颜色),给 ...

  7. 3proxy代理软件文档说明

    官方英文原版说明:http://www.3proxy.ru/howtoe.asp 配置文件的简要说明:如果你的英文理解力好,可以试着研究一下他的手册. 以实例说明吧 nscache 65536域名解析 ...

  8. SQL Server连接Oracle详细步骤

    http://blog.csdn.net/weiwenhp/article/details/8093105 我们知道SQL Server和Oracle其实很多原理都类似.特别是一些常用的SQL语句都是 ...

  9. Java实现简单版SVM

    Java实现简单版SVM 近期的图像分类工作要用到latent svm,为了更加深入了解svm,自己动手实现一个简单版的.         之所以说是简单版,由于没实用到拉格朗日,对偶,核函数等等.而 ...

  10. C和指针 (pointers on C)——第四章:语句(上)

    第四章--语句(上) 总结总结!!! C没有布尔类型,所以在一些逻辑推断时候必须用整型表达式,零值为假,非零值为真. for比while把控制循环的表达式收集起来放在一个地方,以便寻找. do语句比w ...