Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is _In_ in C++?

I have searched this up rather a lot, but come up with no helpful results.

I am currently trying to program simple DirextX game for Windows 8 Metro, and have come across _In_ rather a lot. I'm just wondering what it is.

Also, I have seen a lot of the use of ^ as the pointer * which I found odd. On top of this, some classes have an interface of ref class MyClass, which I believe is for C# legibility.

Anyway, any help would be brilliant.

like image 354
Infinity James Avatar asked Jul 12 '12 17:07

Infinity James


People also ask

What does _IN_ mean?

Example: The _In_ Annotation The _In_ annotation indicates that: The parameter must be valid and will not be modified. The function will only read from the single-element buffer. The caller must provide the buffer and initialize it. _In_ specifies "read-only".

What is SAL c++?

SAL is the Microsoft source code annotation language. By using source code annotations, you can make the intent behind your code explicit. These annotations also enable automated static analysis tools to analyze your code more accurately, with significantly fewer false positives and false negatives.

What is Sal H?

* sal.h provides a set of annotations to describe how a function uses its. * parameters - the assumptions it makes about them, and the guarantees it makes. * upon finishing.


1 Answers

It is a SAL annotation, used for code analysis. The annotations themselves are defined as macros that, in normal builds, expand to nothing.

The ^ and ref class are features of C++/CX, a set of language extensions developed to make it easier to build Metro style apps for Windows 8 in C++. Neither is a part of standard C++. The documentation (linked previously) has links to tutorials and references describing the language extensions.

like image 176
James McNellis Avatar answered Sep 28 '22 09:09

James McNellis