随笔分类 -  Life

摘要:/* 基类定义以下三种类型的成员变量: public: 基类和派生类对象都可以访问 protected: 基类和派生类的对象都不可以访问,可以在各自的成员函数中访问 private: 基类和派生类对象都不可以访问,派生类不可以在其成员函数中访问 */ #include <iostream> usin 阅读全文
posted @ 2016-01-28 16:25 YaLing 阅读(276) 评论(0) 推荐(0)
摘要:多态是什么?简单来说,就是某段程序调用了一个API接口,但是这个API有许多种实现,根据上下文的不同,调用这段API的程序,会调用该API的不同实现。今天我们只关注继承关系下的多态。#include #include using namespace std;class Father{public: ... 阅读全文
posted @ 2016-01-10 15:07 YaLing 阅读(275) 评论(0) 推荐(0)
摘要:在http://libevent.org/ 上下载了libevent-2.0.22-stable.tar.gz参照网上的说法, 1)在以下3个文件开头添加“#define _WIN32_WINNT 0x0500” libevent-2.0.21-stable\event_iocp.c ... 阅读全文
posted @ 2015-12-29 17:24 YaLing 阅读(337) 评论(0) 推荐(0)
摘要:// print float bits #include <iostream> using namespace std; int main() { float num = 0.15625; int n = *(int*)(void*)# cout<<(n)<<endl; for(int i = 0; 阅读全文
posted @ 2015-12-27 14:57 YaLing 阅读(162) 评论(0) 推荐(0)