[SIZE=16px][COLOR=#000000]hi, do i´m forced to declare all pointers as nullptr if i´m not initializing it ?..
i remember read some places coding:
class AActor * anActor;
but in other places:
class AActor * anActor = nullptr;
[/COLOR]
[/SIZE]
[SIZE=16px][COLOR=#000000]i noticed sometimes if i don´t put nullptr, Unreal crashes, but still don´t get why in some is needed and why in other not…[/COLOR][/SIZE]
[SIZE=16px][COLOR=#000000]theorically this should crash, but does not…:
//header file
class UStaticMeshComponent* anActor;
//cpp constructor
anActor = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh"));
anActor is not requestion dinamic memory allocation, so, why compiler accepts it?[/COLOR][/SIZE]
[SIZE=16px][COLOR=#000000]or maybe the class CreateDefaultSubobject<>() template is allocating automatically memory for me ?[/COLOR][/SIZE]