When we want to define struct in C++, which way shold we use?
- Create C++ class UUserDefinedStruct inherited
- Create header file manually and define structs as many as we want(Not define class. Struct only.)
When we want to define struct in C++, which way shold we use?
Second.
Child of UUserDefinedStruct is going to be UCLASS.
UCLASS()
class CONTENTEXAMPLESCPP_API UMyUserDefinedStruct : public UUserDefinedStruct
{
GENERATED_BODY()
};
If you want to create a USTRUCT try this:
USTRUCT()
struct FMyStruct
{
GENERATED_BODY()
};
(Legacy wiki post: https://www.ue4community.wiki/Legacy/How_To_Make_UStruct)