C++ Need help with some basic stuff

Hi, this is my first post here at ue forums so if this post is not in right section I’m sorry.I’ve started learning c++ a couple days and took one course about UE4.It’s going good so far, but I really don’t get some things, and why we use them so I hope that someone can help me to sort this out in my head.
As an exercise in a course we are making “Bull and Cow” game. We are using classes, but I’m not sure why and what are classes of. As far as I know they are having 2 parts: public and private and I’m not sure can I define private functions and public variables because we only put functions in public section and variables on private.Next thing that is bit confusing is “const” and “constexpr” thing,what is difference between them and when we use them?And last one is about struct,i’ve heard that we can store 2 integers there and it is like class but more simpler,can we store more things there ,or some other type insted of int(32)?Sorry for long lost and many question but i didn’t know where to post this because it is kinda related to UE4
-Can someone explain me classes(What they do,are they usefull etc.) and do we use them in UE much?
-Can we declare functions in private part of classes and variables on public part?
-Const and constexpr what are they used for,and difference between them?
-When we use struct a,what type of data can it store and how much of it?
Here is picture of my class and it is related to my 2nd question(only functions are in public part and variables in private)

The big difference between classes and structs is classes default to private access for methods/members, while structs default to public access. Often times classes are used for heavier objects, while structs are used for simple data types.

Yes, it just depends on if you want other systems/users/etc to be able to access a function/member. This all goes into API creation and how you want other programmers to interact with your code. There are best practices and such, but no “right way” or anything with regard to what protection level to use.

Const is normally seen as a “contract” that says, “You can call this method as many times as you want, and it won’t change the object”. Let’s say I have a Stat Class that has two public functions: SetStat, and GetStat. SetStat would change the internal stat value, so it can’t be const. GetStat only returns the value (and never changes it), so it can be const. There are ways around the const keyword (the terrible const_cast), so it’s not 100% that the method won’t change the object - but 99.9% of code that is marked as const is basically “read only” as far as the object is concerned.

constexpr is a more strict version of constant that adds a few more restrictions: 1.) constexpr must return literal values. 2.) constexpr can only be called from other constexpr methods. 3.) constexpr is inherently inlined.

Anything and as much as you want. There are no inherent limits to how much a Class or Struct can hold. If you wanted, you could make your entire game into 1 huge struct/class. You normally don’t for organizational purposes. Code that is broken up in logically chunks (AI, Collision, Physics, etc) is easier to debug and can be re-used in other projects.

I would highly suggest you spend some time just googling these various questions as most of these aren’t UE specific and you can find much more in-depth answers than ones we can provide in a forum setting. Basic C++/Programming paradigms are great to learn and will only help you as you explore UE4 and its special twist on some of those things.

Thank you so much for time spent to answer my questions,i googled some myself but answers were not clear enough (at least for me),now i got most of the stuff.