← BYTES
C++·Starter·Ref: 8.1.4

What is the difference between a class and a struct in C++?

Have a question about this video? Mention reference 8.1.4 when you contact us.

a.There is no difference at all
b.Members and inheritance default to private in a class, public in a struct
c.structs cannot have member functions
d.classes cannot have public members
class and struct are otherwise identical in C++ (both can have methods, constructors, inheritance) -- the only real difference is the default access level: private for class, public for struct.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES814#C