2009年12月28日
摘要: 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 阅读(274) 评论(0) 推荐(0) 编辑
  2009年12月25日
摘要: 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 阅读(181) 评论(0) 推荐(0) 编辑
  2009年12月21日
摘要: //方案— 优点:仅使用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 阅读(1160) 评论(0) 推荐(0) 编辑
  2009年11月30日
摘要: Windows SDK笔记(一):Windows程序基本结构一、概述Windows程序具有相对固定的结构,对编写者而言,不需要书写整个过程,大部分过程由系统完成。程序中只要按一定的格式填写系统留给客户的那一小部分。所需要完成的有:窗口类的定义、窗口的建立、消息函数的书写、消息循环。二、消息处理函数Windows程序是事件驱动的,对于一个窗口,它的大部分例行维护是由系统维护的。没个窗口都有一个消息处... 阅读全文
posted @ 2009-11-30 16:15 Kevin Johnson 阅读(564) 评论(0) 推荐(0) 编辑
  2009年11月26日
摘要: C++中的new其实是一个很糊弄人的术语,它有两种不同的含义,new运算符(new operator)和new函数(operator new),值得记录一下。一 new运算符最常用的是作为运算符的new,比如:string *str = new string(“test new”);作为运算符,new和sizeof一样,是C++内置的,你不能对它做任何的改变,除了使用它。n... 阅读全文
posted @ 2009-11-26 11:10 Kevin Johnson 阅读(374) 评论(0) 推荐(0) 编辑