上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
摘要: 析构函数定义为虚函数原因先看下面一段程序:#include using namespace std;class Person{public:virtual~Person()//加了virtual,讲析构函数声明为虚函数{ cout << "Person::~Person()" << endl;}};... 阅读全文
posted @ 2015-07-19 21:40 imKirin 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 目录IP协议首部格式地址解析协议 ARP逆向地址解析协议 RARP网际控制报文协议 ICMP网际组管理协议IGMPIP 数据报首部IP数据报首部格式:最高位在左边,记为0 bit;最低位在右边,记为31 bit版本:占 4 位,指 IP 协议的版本目前的 IP 协议版本号为 4 (即 IPv4)首部... 阅读全文
posted @ 2015-07-18 22:30 imKirin 阅读(666) 评论(0) 推荐(0) 编辑
摘要: Linux netstat命令详解简介Netstat 命令用于显示各种网络相关信息,如网络连接,路由表,接口状态 (Interface Statistics),masquerade 连接,多播成员 (Multicast Memberships) 等等。输出信息含义执行netstat后,其输出结果为A... 阅读全文
posted @ 2015-07-18 22:22 imKirin 阅读(298) 评论(0) 推荐(0) 编辑
摘要: i++是否原子操作 不是原子操作。理由:1.i++分为三个阶段:内存到寄存器寄存器自增回内存这三个阶段中间都可以被中断分离开.2.++i首先要看编译器是怎么编译的,某些编译器比如VC在非优化版本中会编译为以下汇编代码:__asm{ moveax,dword ptr[i] inc eax movd... 阅读全文
posted @ 2015-07-15 12:52 imKirin 阅读(1436) 评论(0) 推荐(0) 编辑
摘要: 引用和指针的比较引用是C++中的概念,初学者容易把二者混淆。例1: int m; int &n = m; 在这里,n相当于是m的别名,对n的任何操作就是对m的操作。n既不是m的拷贝,也不是指向m的指针,其实n就是m它自己。例2: int i = 0; int j = 5; int &k = i; k... 阅读全文
posted @ 2015-06-25 10:15 imKirin 阅读(306) 评论(0) 推荐(0) 编辑
摘要: Contains Duplicate IIIGiven an array of integers, find out whether there are two distinct indicesiandjin the array such that the difference betweennum... 阅读全文
posted @ 2015-06-23 14:43 imKirin 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Contains Duplicate IIGiven an array of integers and an integerk, find out whether there there are two distinct indicesiandjin the array such thatnums[... 阅读全文
posted @ 2015-06-23 13:12 imKirin 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Contains DuplicateGiven an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at leas... 阅读全文
posted @ 2015-06-23 11:11 imKirin 阅读(165) 评论(0) 推荐(0) 编辑
摘要: AVL树参考了:http://www.cppblog.com/cxiaojia/archive/2012/08/20/187776.html修改了其中的错误,代码实现并亲自验证过。 平衡二叉树(Balanced Binary Tree)是二叉查找树的一个进化体,也是第一个引入平衡概念的二叉树。19... 阅读全文
posted @ 2015-06-17 15:07 imKirin 阅读(1364) 评论(0) 推荐(0) 编辑
摘要: 关于const和define的内存分配问题const与#define宏定义的区别----C语言深度剖析1, const定义的只读变量在程序运行过程中只有一份拷贝(因为它是全局的只读变量,存放在静态区),而#define定义的宏常量在内存中有若干个拷贝。2, #define宏是在预编译阶段进行替换,而... 阅读全文
posted @ 2015-06-12 18:52 imKirin 阅读(2909) 评论(0) 推荐(2) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页