C/C++
文章平均质量分 81
yioo_2007
这个作者很懒,什么都没留下…
展开
-
C/C++编译器变量
__VA_ARGS____LINE____FILE___LINUX_WIN32_WIN32_WCEUNICODE || _UNICODE__cplusplus ___________________Ref___________________________________#pragma (push, n) n = 1, 2, 4, 8,原创 2012-10-23 11:11:09 · 674 阅读 · 0 评论 -
warning C4541: 'dynamic_cast' used on polymorphic type 'class CWnd' with /GR-; unpredictable behavio
是因为没有打开run-time type information 支持就使用'dynamic_cast' 菜单project-setting-c/c++ c++ language - enable run-time type information (RTTI)转载 2012-12-12 15:41:43 · 579 阅读 · 0 评论 -
一个资源打包工具完整代码
#include #include static char g_mem[5 * 1024 * 1024];#define MORE 17#define min(a, b) ((a) < (b) ? (a) : (b))typedef struct _ResMap{ char *pName; int iPos; int iLen; int iOrg原创 2012-12-26 10:34:04 · 394 阅读 · 0 评论 -
LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup 问题的解决
Welcome to my blog! vc中error LNK2001:unresolved external symbol _WinMain@16的解决方法 一,问题描述error LNK2001: unresolved external symbol _WinMain@16debug/main.exe:fatal error LNK 1120:1 unresolved exter转载 2012-12-13 16:13:40 · 548 阅读 · 0 评论 -
各种字符串hash函数
/// @brief BKDR Hash Function /// @detail 本 算法由于在Brian Kernighan与Dennis Ritchie的《The C Programming Language》一书被展示而得 名,是一种简单快捷的hash算法,也是Java目前采用的字符串的Hash算法(累乘因子为31)。 size_t BKDRHash(const char转载 2012-12-18 09:55:51 · 278 阅读 · 0 评论 -
__cdecl __stdcall区别
如果通过VC++编写的DLL欲被其他语言编写的程序调用,应将函数的调用方式声明为__stdcall方式,WINAPI都采用这种方式,而C/C++缺省的调用方式却为__cdecl。__stdcall方式与__cdecl对函数名最终生成符号的方式不同。若采用C编译方式(在C++中需将函数声明为extern "C"),__stdcall调用约定在输出函数名前面加下划线,后面加“@”符号和参数的字转载 2012-11-23 17:13:32 · 276 阅读 · 0 评论 -
共享段
#pragma data_seg("Shared") extern "C" __declspec(dllexport) char g_buf[1024] = {0}注意: 这里必需将g_buf初始化,否则变量不会放在指定的节,而是放在bss节中 #pragma data_seg() #pragma comment(linker,"/原创 2013-02-04 12:41:10 · 380 阅读 · 0 评论