Reputation: 3670
I came across this code but I have not seen [in] or [out] before. What are they?
HRESULT QueryInterface([in] REFIID riid, [out] void **ppvObject) {
}
Upvotes: 2
Views: 213
Reputation: 1430
These are directional IDL attributes. They indicate the direction that data is being passed.
Upvotes: 4
Reputation: 39807
As provided in your question, the code probably won't compile. That being said, though not common you might come across code such as:
HRESULT QueryInterface(IN REFIID riid, OUT void **ppvObject)
which compiles because somewhere IN and OUT are #define'd (to be empty). This is sometimes done with pointers to indicate if the parameters are input (read only), or output (written to), or BOTH. This indication is for the reader's benefit.
Upvotes: 3
Reputation: 14376
it's an indication of a value that's being sent [in]
to a function or, in the case of [out]
it's being changed and so is an [out]put
Upvotes: 2