Understanding default constructor class parameter

Hi, I new to to UE4 and I’m also not that expert in C++; I’m trying to understand the constructor class parameter. Unfortunately, I don’t know what it means exactly, thus I don’t have the name of the concept to make a good research about it. Anyway, I hope sombebody help me to understand this or guide me to the answer:


AFPSCharacter::AFPSCharacter(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)

Here it goes my questions:

  1. If FPostConstructInitializeProperties is a class, why it needs to be const? is there a way to set a “new value” to it as a class?
  2. FPostConstructInitializeProperties is really a class passing a PCIP address? Why not a pointer?
  3. As far as I can read C++, AFPSCharacter class :: Its constructor (parameter) : What Super(PCIP) here means? I meand would be fine for me if Super was inside the constructor at the first line, but what exactly means Super this way and how should I read it?

Thanks in advance

In this case const means that it will not be changed by the function, or an error will arise while compiling.

class simply pre-declares the class, without having to know its definition. It’s passed as a reference automatically when you create an object using GetWorld()->CreateActor(...);, and because of that the compiler does not need to know how much memory the class requires, because it’s not being copied. In Super, which in this case is AActor, the constructor does know the FPostConstructInitializeProperties class, so it can use its data.