What is the difference between a Struct and Class?

In case of C++ there the difference btween struct and class is minimal.

The only difference in case of C++ you should be bother is that in struct everthyning by default have public access level.
Structs in C++ is just left over from C compatibility.

Now in case of Unreal.
Structs, can’t expose UFUNCTION to blueprint, and are more of an data holding structure than object on it’s own. You will notice that in Unreal you very rarely construct struct as an object and more often you just pass it as reference or pointer, with grouped data.

1 Like

So ok,

I admit, this isn’t really a UE4 specific topic, but something that bothered me ever since i started programming C++.

I come from a scripting background, mainly PHP. But I also tried other lanuages. But non of them seem to have something like structs and from what I can tell, Structs and Classes can do the same stuff. I couldnt find any good explanation anywhere else, that is why I post here, since I know a lot of experienced C++ Coders look here.

Can anybody enlighten me?