摘要: 函数参数类型前_In_代表什么在visualC++中属于SAL批注,是为了编译系统在分析代码时发现缺陷用的表示是一个输入参数。可以定义一个_In_的宏,这个宏什么都不做,就是形如这样的。#define _In_ void fun(int _In_ x); 等同于void fun(int x);但是他给出了参数x是输入的意思类似的还有_Out_#define _Out_// In.h#ifndef _In_ // 如果没有这样的宏,那么多文件都包含In.h编译就会报错了#define _In_//....#endif // In.c#include "In.h" // mai 阅读全文
posted @ 2014-04-03 23:06 阿祖叔叔 阅读(1913) 评论(0) 推荐(0) 编辑
摘要: // A simple program that uses LoadLibrary and // GetProcAddress to access myPuts from Myputs.dll. #include #include typedef int (__cdecl *MYPROC)(LPWSTR); int main( void ) { HINSTANCE hinstLib; MYPROC ProcAdd; BOOL fFreeResult, fRunTimeLinkSuccess = FALSE; // Get a handle to the... 阅读全文
posted @ 2014-04-03 21:29 阿祖叔叔 阅读(635) 评论(0) 推荐(0) 编辑
摘要: 10.在16位的机器上跑下列函数的结果是void foo() { int i=65536; cout<<i<<","; i=65535; cout<<i; } 答案:0,-1解析:计算机中负整数用二进制补码表示int、short、char 类型超出范围赋值----------说说原码,反码,补码:http://blog.csdn.net/cnm_1314/article/details/7728409(以下使用g++编译器,win32平台)假设short类型的大小是2字节,int类型的大小是4个字节。short能表示-32768~3276 阅读全文
posted @ 2014-04-03 21:23 阿祖叔叔 阅读(1132) 评论(0) 推荐(0) 编辑