随笔-5  评论-0  文章-0  trackbacks-0
12 2009 档案
CreateFile函数详解
摘要: The CreateFile function creates or opens the following objects and returns a handle that can be used to accessthe object: files pipes mailslots communications resources disk devices(Windows NT only) c...阅读全文
posted @ 2009-12-28 19:07 Kevin Johnson 阅读(122) | 评论 (0) 编辑
memset用法详解
摘要: memest原型 (please type "man memset" in your shell) void *memset(void *s, int c, size_t n); memset:作用是在一段内存块中填充某个给定的值,它对较大的结构体或数组进行清零操作的一种最快方法。 常见的三种错误 第一: 搞反了c 和 n的位置. 一定要记住 如果要把一个char a[20]清零, 一定...阅读全文
posted @ 2009-12-25 10:55 Kevin Johnson 阅读(47) | 评论 (0) 编辑
如何在C++获得系统时间
摘要: //方案— 优点:仅使用C标准库;缺点:只能精确到秒级 #include <time.h> #include <stdio.h> int main( void ) { time_t t = time(0); char tmp[64]; strftime( tmp, sizeof(tmp), "%Y/%m/%d %X %A 本年第%j天 %z",localtime...阅读全文
posted @ 2009-12-21 09:54 Kevin Johnson 阅读(765) | 评论 (0) 编辑