Call Us : +91-8376986802 (Viber, WhatsApp)

Difference between struct and class in terms of Access Modifier



All members of a class are private by default, whereas fields of a struct are public. Default access of a base class is private for classes and public for structures.

For Example
struct Emp {
char Name[20]; // Here Name variable is public
};

Leave a Reply