Structs vs Class

So Struct is “basically” a class but with it’s access modifier set to public, then why are we using a Class for our CurrentTries and MaxTries? And of that matter setting them to be private and using a getter method, I get the Idea of teaching the fundamentals of C++ but isn’t just using a Struct with two public declared integers better for optimization?

Privacy & Terms