08 2017 档案

摘要:#ifndef LEAPYEAR_INCLUDED#define LEAPYEAR_INCLUDED class LeapYear{public: bool IsLeapYear(int year);};#endif #include "leapyear.hpp" auto Or = [](bool 阅读全文
posted @ 2017-08-22 21:21 atoman 阅读(565) 评论(0) 推荐(0)
摘要:#include <stdio.h> void main(){ printf("hello world.\n"); } gcc hello.c -o hello -std=c99 编译通过。 但通过如下编译则失败—— g++ hello.c -o hello -std=c++11 失败信息为: he 阅读全文
posted @ 2017-08-16 17:47 atoman 阅读(1477) 评论(0) 推荐(0)
摘要:C++中有两种类型的容器:顺序容器和关联容器。 顺序容器主要有vector、list、deque等。其中vector表示一段连续的内存,基于数组实现,list表示非连续的内存,基于链表实现,deque与vector类似,但是对首元素提供插入和删除的双向支持。 关联容器主要有map和set。map是k 阅读全文
posted @ 2017-08-16 11:47 atoman 阅读(263) 评论(0) 推荐(0)
摘要:##用来连接前后两个参数,把它们变成一个字符串。 内核中有很多的宏定义,在宏定义 define 中经常看到两个字符串##和#,这里把它的用法做一下说明: ## 是一个连接符号,用于把参数连在一起,例如: #define FOO(arg) my##arg 则 FOO(abc) 相当于 myabc #d 阅读全文
posted @ 2017-08-11 11:04 atoman 阅读(1764) 评论(0) 推荐(0)
摘要:WORD wTemp = 0; memcpy((WORD *)&wTemp, ptPort+1, sizeof(WORD)); //if (STD_WORD_ALL == *(WORD *)(pucTpMsk+1)) if (STD_WORD_ALL == wTemp) { //*(WORD *)( 阅读全文
posted @ 2017-08-09 10:38 atoman 阅读(290) 评论(0) 推荐(0)