Im starting to getting a bit confused with the way structs are managed in c++. In the bulls and cows part, we learnt that we can initialize structs like so:
struct BullsNCows{
int32 Bulls;
Int32 Cows;
};
// then
BullsNCows Points = {10, 5};
In this case we will have a Points struct of the type BullsNCows that has 10 bulls and 5 cows.
Now in this lecture I see that the teacher is calling another struct like this:
FCollisionQueryParams TraceParams(FName(TEXT("")), false, GetOwner());
I have the impression that it should’ve been
FCollisionQueryParams TraceParams{FName(TEXT("")), false, GetOwner()};
or
FCollisionQueryParams TraceParams = {FName(TEXT("")), false, GetOwner()};
are all of these options valid an in C++ the use of () or {} is almost interchangeable, or am I missing something here?
Another thing I don’t understand, I thought when you create an if statement with the name of a variable as a condition you were testing if the variable was a boolean returning true, but in this lecture the teacher writes:
if (ActorHit)
in this case ActorHit is an AActor, so what is the evaluation the if statement does?
Thanks!