_In_ 是什么意思

函数参数类型前 _In_
代表什么
 

 
在visual C++中属于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"
 
 
// main.c
#include "In.h"
 
原文地址:https://www.cnblogs.com/LeoGodfrey/p/3644107.html