05 2013 档案

C++ Primer 读书笔记 - 第十三章
摘要:1. Initialization和Assignment不一样。其中Initialization包括direct-initialization (如A a(...))和copy-initialization (如 A a = b;) 注意A a = b为copy-initialization, 而A a; A b; a = b;为Assignment。2. We cannot copy objects of the IO types, so we cannot use copy-initialization on objects of these types.3. As the copy .. 阅读全文

posted @ 2013-05-31 03:36 NULL00 阅读(449) 评论(0) 推荐(1)

C++ Primer 读书笔记 - 第十二章
摘要:1. 类中成员默认属性为private,private成员只对类里面的其他成员可见。2. 在类里面定义的成员函数默认为inline函数。如果只是在类中声明,那么其定义也要有inline关键字,inline关键字在声明和定义处任意出现一次就行。inline函数的定义必须出现在头文件中。3. 声明为const的成员函数不能改变调用它的对象的数据成员,const在声明和定义中都要写明。4. data abstraction是指我们只知道接口(interface),不知道内部如何实现(implementation)。5. encapsulation是指将低层次的元素组装成高层次的实体。例如一个函数,一 阅读全文

posted @ 2013-05-30 11:04 NULL00 阅读(551) 评论(0) 推荐(1)

C++ Primer 读书笔记 - 第十一章
摘要:#include <algorithm>1. find()函数2. accumulate()函数3. find_first_of()函数的两个range的类型可以不同,但是两个range内部的类型必须相同。4. fill()函数,使用时必须保证空间是足够的。 fill_n(back_inserter(vec), 10, 0);//appends 10 elements to vec5. replace()函数改变容器内部,replace_copy()函数不改变容器内部,而是自己新拷贝一份。6. sort()函数,unique()函数,unique_copy()函数,stable_s 阅读全文

posted @ 2013-05-29 07:06 NULL00 阅读(773) 评论(0) 推荐(0)

C++ Primer 读书笔记 - 第十章
摘要:1. map和set中的key是唯一的,multimap和multiset中的key可以出现多次。2. Whenever we use an associative container, its keys have not only a type, but also an associated comparsion function.3. The value_type is a pair and that we can chagne the value but not the key member of that pair.4. 用下标插入元素时,内部操作是这样的: - 找key,找不到 .. 阅读全文

posted @ 2013-05-28 09:23 NULL00 阅读(540) 评论(0) 推荐(0)

C++ Primer 读书笔记 - 第九章
摘要:1. Two constraints that element types must meet: - The element type must support assignment. - We must be able to copy objects of the element type. Soreferences, IO library types, auto_ptr typeare not permitted.2. Only vector and deque support iterator arithmetic and the use of relational operato... 阅读全文

posted @ 2013-05-28 02:41 NULL00 阅读(503) 评论(1) 推荐(0)

C++ Primer 读书笔记 - 第八章
摘要:1. IO library types do not allow copy or assignment. Only element types that support copy can be stored in vectors or other container types. We cannot have a parameter or return type that is one of the stream types. If we need to pass or return an IO object, it must be passed or returned as a poin.. 阅读全文

posted @ 2013-05-27 06:58 NULL00 阅读(575) 评论(0) 推荐(0)

C++ Primer 读书笔记 - 第七章
摘要:1. To invoke a function we use the call operator, which is a pair of parentheses. The operands to the call operator are the name of the function and a (possibly empty) comma-separated list of arguments.#include <iostream>using namespace std;string::size_type find_char(const string &s, char 阅读全文

posted @ 2013-05-26 12:11 NULL00 阅读(452) 评论(0) 推荐(0)

C++ Primer 读书笔记 - 第六章
摘要:这一章讲控制结构,和C,Java没区别。跟C不同的是,C++增加了try blocks and Exception Handling#include <iostream>#include <stdexcept>using namespace std;void foo(){ int b = 0; if (b == 0) throw runtime_error("b == 0"); int a = 4/b; cout << a << endl;}void bar() throw(int){ throw 5;}int main(){ 阅读全文

posted @ 2013-05-25 03:59 NULL00 阅读(444) 评论(0) 推荐(0)

C++ Primer 读书笔记 - 第五章
摘要:这一章的内容和C语言基础知识大同小异。1. i++ 与 ++i 的效率问题 i++的话,需要保存原来的值,然后增加 i,之后返回 i 原来的值;++i 直接增加 i,然后返回当前的 i 值,所以少做一步工作。2. Setting the pointer to 0 after the object it refers to has been deleted makes it clear that the pointer points to no object. It is legal to delete a pointer whose value is zero; doing so has .. 阅读全文

posted @ 2013-05-20 10:01 NULL00 阅读(365) 评论(0) 推荐(0)

C++ Primer 读书笔记 - 第四章
摘要:这一章更多的是在讲C语言的东西。Pointers to const Objectsconst double *ptrconst Pointersdouble *const ptr = &value //必须初始化const Pointer to a const Objectcosnt double *const ptr = &valuePointers and TypedefsTypedef string *pstringconst pstring cstr;其实const pstring cstr 等价于 string *const cstrconst int *pci_ok 阅读全文

posted @ 2013-05-20 04:11 NULL00 阅读(412) 评论(0) 推荐(1)

C++ Primer 读书笔记 - 第三章
摘要:1. std::string size()函数返回值为string::size_type,用下标时,也用string::size_type作为index的类型#include <iostream>#include <cstdio>#include <string>using namespace std;int main(){ string s = "abc"; cout << s << endl; cin >> s; cout << s << endl; string line; 阅读全文

posted @ 2013-05-19 13:01 NULL00 阅读(403) 评论(0) 推荐(0)

C++ Primer 读书笔记 - 第二章
摘要:1. 这章谈到了初始化和赋值其实是不同的,这使我想起了构造函数中的普通构造函数,拷贝构造函数,赋值构造函数,详见博文C++中的构造函数与析构函数 string这个类有default constructor,即初始化为"".2. 一个变量在一个程序中能够声明多次,但只能定义一次。3. Nonconst varialbes are extern by default. To make a const variable accessible to other files we must explicitly specify that it is extern.4. There i 阅读全文

posted @ 2013-05-19 10:27 NULL00 阅读(521) 评论(0) 推荐(0)

C++ Primer 读书笔记 - 第一章
摘要:这一章算是简介。自己写了几个程序。1. main函数的返回值int main(){ //after ./a.out, execute 'echo $?', it will output 7. return 7;}2. 对comment的理解#include <iostream>using namespace std;int main(){ cout << "/*"; cout << "*/"; cout << /* "*/" */";}3. 对输入的理解#inc 阅读全文

posted @ 2013-05-19 08:02 NULL00 阅读(752) 评论(3) 推荐(0)

Storage Systems
摘要:1. MountMount - Combine the FSes into one namespace. All files accessible in a Unix system are arranged in one big tree, the file hierarchy, rooted at /. These files can be spread out over several devices. The mount command serves to attach the filesystem found on some device to the big file tree.Th 阅读全文

posted @ 2013-05-19 06:12 NULL00 阅读(308) 评论(0) 推荐(0)

导航