[C++] Crash when calling a non-static method in a static method

Hello,

I have just started in C++, i have a static function that is called in BP and in this function I would like to call another function that is not static. What should be a simple manipulation, generates only errors that I do not understand.

void AClass::Method01(FString string01, FString string02) {

	AClass class;
	class.Method02(string01);

}

This code does not generate an error but makes the game crash at startup.
Thank you in advance for your help.

void AClass::Method01(FString string01, FString string02) {
	AClass class  = myObjectClass->GetDefaultObject<AClass>(); // myObjectClass = class of object or TSubClassOf<> ).
	class->Method02(string01);
}
1 Like

After several searches, here is the call that solved my problem

void AClass::Method01(AClass class, FString string01, FString string02) {
	class->Method02(string01);
}