What does the OUT parameter do?

Hello,

in BuildingEscape, we use #define OUT, but what does this do? I don’t fully understand it yet.
What is the OUT parameter and why do we put it in front of some variables?
I searched on Google, but I could not find what I was looking for.

Thanks in advance.

It does absolutely nothing.

#define OUT

This is a macro, a simple text replacement. It will replace all uses of “OUT” in the file with nothing. Ben is using it as a comment that it’s an out parameter.

What does OUT normally do? Why is it necessary to #define OUT and make it do nothing?

There is no meaning. The definition is #define OUT

#define BILL BOB

Would replace all uses of BILL with BOB.

It’s not. Feel free to remove it.

If it doesnt do anything. Why are we then putting it in front of some variables?
Sorry for a lot of questions. (and Happy New Year in advance)

To comment that it’s an output parameter.

FHitResult HitResult;
FCollisionQueryParams TraceParameters(FName(TEXT("")), false, GetOwner());
GetWorld()->LineTraceSingleByObjectType(
		OUT HitResult,
		GetReachLineStart(),

HitResult is being given a value by the function. It’s an output parameter.
It would work the same without it. Alternatively you could add a prefix to the variable name or use a multiline comment.

Thanks for the help!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.