C++
文章平均质量分 85
无人驾驶小司机
这个作者很懒,什么都没留下…
展开
-
C++ Primer_8 IO库
1. using声明具有如下的形式: using namespace::name; // 一旦声明了上述语句,就可以直接访问命名空间中的名字。注意:用到的每个名字都必须有自己的声明语句,而且每句话都得以分号结束。2.示例:#include // using declaration; when we use the name cin, we get the one fro原创 2017-01-23 13:21:18 · 379 阅读 · 0 评论 -
Essential C++ 4_Object-Based Programming
Before we can use a class, we must make it known to the program because the class is not built into the language. Usually, we do this by including aheader file:#include string pooh[ 4 ] = {原创 2017-01-21 11:41:19 · 467 阅读 · 0 评论 -
Essential C++ 1_Basic C++ Programming
一个函数的定义包含四个部分:返回类型、函数名、一个括号包围的形参列表、函数体。main函数的返回类型必须为int,main的返回值被用来指示状态,返回0表明成功,非零的返回值含义由系统定义,通常用来指出错误类型。类型是程序设计最基本的概念之一,一种类型不仅定义了数据元素的内容,还定义了这类数据上可以进行的运算。“.”后跟一个反斜线\指出该文件在当前目录中。cerr用来输出警告和错误消息,clog用原创 2017-01-18 16:04:31 · 692 阅读 · 0 评论 -
Essential C++ 2_Procedural Programming
Before a function can be called within our program, it must be declared. A function declaration allows the compiler to verify the correctness of its use � whether there are enough parameters, whether原创 2017-01-19 20:20:42 · 987 阅读 · 0 评论 -
回调函数 Callback function 的概念与程序示例
1. 专业解释: In computer programming, a callback is a reference to executable code, or a piece of executable code, that is passed as an argument to other code. This allows a lower-level software lay原创 2017-03-15 15:58:22 · 3420 阅读 · 0 评论 -
C++模板与标准模板库(STL库)介绍
1. 概论 C++ 语言的核心优势之一就是便于软件的重用 C++中有两个方面体现重用: 1. 面向对象的思想:继承和多态,标准类库 2. 泛型程序设计(generic programming)的思想:模板机制,以及标准模板库机制,以及标准模板库STL泛型程序设计 泛型程序设计,简单地说就是使用模板的程序设计法。 将一些常用的数据结构(比如链表原创 2017-02-26 17:12:47 · 3248 阅读 · 0 评论 -
C++ Primer_3 字符串、向量和数组
3.1 命名空间的using声明using声明具有如下的形式: using namespace::name; // 一旦声明了上述语句,就可以直接访问命名空间中的名字。注意:用到的每个名字都必须有自己的声明语句,而且每句话都得以分号结束。示例:#include // using declaration; when we use the name cin, we原创 2017-01-20 21:35:12 · 482 阅读 · 0 评论 -
C++ Primer_7 类
本周6完成!!原创 2017-01-21 11:42:48 · 253 阅读 · 0 评论 -
C++ Primer_6 函数
6.1 函数基础 一个典型的函数定义包含如下部分:返回类型、函数名、0个或多个形参组成的列表及函数体。编写函数:// factorial of val is val * (val - 1) * (val - 2) . . . * ((val - (val - 1)) * 1)int fact(int val){int ret = 1; // local variable t原创 2017-01-21 11:42:26 · 436 阅读 · 0 评论 -
C++ Primer_10 泛型算法
。。。。原创 2017-01-23 22:47:29 · 502 阅读 · 0 评论 -
C++ Primer_9 顺序容器
。。。原创 2017-01-23 22:38:24 · 510 阅读 · 0 评论 -
Essential C++ 5_Object-Oriented Programming
The object-based class mechanisms of Chapter 4 cannot easily model both the commonality and the differences of these fourare-a-kind-of Book classes. Why? It's because this model does not provide sup原创 2017-01-21 11:41:58 · 674 阅读 · 0 评论