摘要:
相信大家都使用过C语言的库函数:printf("%d%d", 1, 2)的吧,使用确实很方便功能也很强大。但是为什么它可以接受多个参数呢?现在我们来解析一下多参的实现原理,网上也找了一些文章。发现解析得都不全面。并且有BUG。先看如下源码:#include <windows.h>#include <stdio.h>#include <winnt.h>void MySprintf(char* szBuffer, const char* szFormat, ...){ va_list pa; // 定义一个指针 va_start(pa, sz 阅读全文
posted @ 2013-04-22 19:10
0x苦行僧
阅读(464)
评论(0)
推荐(0)
摘要:
Windef.h // 基本数据类型的定义WindNt.h // 支持Unicode的类型定义Winbase.h // 内核函数WinUser.h // 用户界面接口WinGdi.h // 图形设备接口函数Windows程序 用户入口WinMain函数在WinBase中如下定义: 1 #ifndef _MAC 2 int 3 WINAPI 4 #else 5 int 6 CALLBACK 7 #endif 8 WinMain( 9 HINSTANCE hInstance,10 HINSTANCE hPrevInstance,11 LPSTR lpCmdLine,1... 阅读全文
posted @ 2013-04-22 16:42
0x苦行僧
阅读(223)
评论(0)
推荐(0)
摘要:
起点 阅读全文
posted @ 2013-04-22 15:57
0x苦行僧
阅读(127)
评论(0)
推荐(0)

浙公网安备 33010602011771号