03 2013 档案

摘要:1. vtable 的基本运作 编译器不会为所有的类加入vtable,但是每个类只能有一个vtable,所有对象共享一个vtable。 类中会暗含一个vpinter来指向对应自己的vtable。sizeof(类) == sizeof(对象);struct Boo { int boo; vir... 阅读全文
posted @ 2013-03-29 17:32 J.Way.C 阅读(125) 评论(0) 推荐(0)
摘要:1. auto,自动检测变量初始化类型,有些地方用起来特别方便std::map addrBooks;// some inserting ...// iterate elemants// way before c11std::map::iterator it = addrBooks.begin();/... 阅读全文
posted @ 2013-03-29 11:35 J.Way.C 阅读(155) 评论(0) 推荐(0)
摘要:1. How to use epoll ? A complete example in c.Link2. 14种时间复杂度对应的相关算法.Link3. Large-Scale C++ Software Design4. 14 lessons after 5 years of professional... 阅读全文
posted @ 2013-03-15 09:57 J.Way.C 阅读(120) 评论(0) 推荐(0)
摘要:1. std::auto_ptrstruct A{ ~A(){printf("~A\n");}};void fun( std::auto_ptr tmp ){ printf("fun %p size%d\n", &(*tmp), sizeof(tmp));}int main(int argc, ch... 阅读全文
posted @ 2013-03-14 11:51 J.Way.C 阅读(101) 评论(0) 推荐(0)
摘要:1. forward declaration// Functionvoid fun(int); 在此之后的代码可以引用fun,而fun的定义必须在某个地方提供。// Variables may have only forward declaration and lack definition// D... 阅读全文
posted @ 2013-03-13 17:28 J.Way.C 阅读(116) 评论(0) 推荐(0)
摘要:1. 区别 默认的成员,继承修饰,struct为public,class为private。2. 类和结构体的拷贝,赋值,在不涉及成员指针情况下可直接使用默认方式即可。3. 构造函数调用时机:Struct s; 拷贝构造时机:Struct s = other; 赋值函数时机:Sturct s; s =... 阅读全文
posted @ 2013-03-06 17:40 J.Way.C 阅读(138) 评论(0) 推荐(0)