# A struct is the same as a class except that

4.5k views
A struct is the same as a class except that

(A) there are no member functions.

(B) all members are public.

(C) cannot be used in inheritance hierarchy.

(D) it does have a this pointer

1 vote

Option B is correct since, by default, all members of a struct are public whereas in a class, by default, all members are private.

selected

## Related questions

1
204 views
Given a string,in which anything except digits are treated as separators, and between each set of separators,there is some substring. count number of separators and substrings and return it with only 1 return statement
Build an FA that accepts the language of all strings of a's and b's such that next-to-last letter is an $a$.