You are declaring two functions, both return nothing.
Both have a first parameter that will be one reference for a data of the kind Pessoa
. This only exists in C++, not in C. Do not confuse with &
used in variables that is a reference operator, i.e., it takes the memory address of the variable. Although the symbol is the same, the features resemble, are very different things. In C++ references are preferable to pointers where possible.
Do not confuse the parameter xn::SkeletonCapability&
with the argument &epochTime
in the line within the example function, they are very different things. In the context of the parameter and the position placed, it indicates that you are declaring a reference. In the context of the argument is having the compiler take the memory address of the variable to be used as argument and pass this address to the pointer that function xnOSGetEpochTime
is waiting.
The second function also has a second parameter whose type is not defined. It is a joker.
This is not very common in C++, there are other ways to solve this. But this is a way to determine that the parameter can take anything. This form is more common in C.
This is a pointer to void
, in a certain way can be read as a pointer to any data, of any kind. That is it is possible to pass anything to this parameter.
Note that this is just the declaration of functions and not their definition. In the definition it is necessary to put, in addition to the type of the parameter, a variable that will receive the data.
In the example placed in later edition shows that two parameters are being rendered unusable with comments. Probably they are not being used within the function, which would generate a Warning. Probably this was the way they used to not create the variable but still maintain the positions of the parameters.
You’re talking about the
void*
? Or are you talking about the parameters only having kind?– Maniero
the
void*
andPessoa&
– Italo Pessoa
But what are you seeing wrong with them? It’s normal. Tell me what your question is
– Maniero
Yeah, I want to know why the parameters only have the guy, the
void*
I get it. ButPessoa&
I don’t understand– Italo Pessoa
The reason is because the language has been defined like this, and someone needs to state in this way that the language allows. If you don’t have a specific question, it becomes difficult to explain.
– Maniero