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. JSP九大内置对象详解

    内置对象特点: 1.            由JSP规范提供,不用编写者实例化. 2.            通过Web容器实现和管理 3.            所有JSP页面均可使用 4.     ...

  2. 记录一次MVC3升级MVC4遇到的问题

    前些天,项目组将项目从mvc3升级至mvc4,完了之后,发现突然涌现出一大堆问题.主要是在前端,Razor引擎升级导致的. Razor是从mvc3开始引入的,用过mvc2的就会知道,Razor用起来确 ...

  3. Java 8 简明教程

    欢迎阅读我编写的 Java 8 介绍.本教程将带领你一步步认识这门语言的所有新特性.通过简单明了的代码示例,你将会学习到如何使用默认接口方法,Lambda表达式,方法引用和可重复注解.在这篇教程的最后 ...

  4. hdoj 1789 Doing Homework again

    Doing Homework again Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Oth ...

  5. JSP实现数据库(MySQL)查询——Java Web练习(二)

    1.创建数据库表student(数据库test01) 2.修改success.jsp页面,修改后的页面整体代码如下: <%@ page language="java" imp ...

  6. Android解析qq聊天记录表情

    偶然在一个需求中需要解析qq聊天记录表情,表情的格式是以/开始,比如:你好啊?/微笑,在网上找了半天,也没能找到一个比较合适的,所以准备自己实现一下,首先要将表情图片和表情字符对上号,我想了几种解决方 ...

  7. 使用CLRMD时通过Symbol Server找Dac的位置来初始化ClrRuntime

    博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:使用CLRMD时通过Symbol Server找Dac的位置来初始化ClrRuntime.

  8. yii2

    yii2框架官方说明文档 http://www.yiiframework.com/doc/guide/2.0/zh_cn/caching.page yii2创建您的第一个application应用 h ...

  9. jetty-如何配置虚拟主机【转】

    jetty-如何配置虚拟主机[转]http://weifly.iteye.com/blog/1152688 官方配置:http://wiki.eclipse.org/Jetty/Howto/Confi ...

  10. ZBar只扫描二维码/条形码

    You can add these codes for ImageScanner scanner.setConfig(0, Config.ENABLE, 0); //Disable all the S ...