The Gateway to Computer Science Excellence
0 votes
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
in Object Oriented Programming by Boss (49.3k points) | 2k views

1 Answer

+1 vote
Best answer
Option B is correct since, by default, all members of a struct are public whereas in a class, by default, all members are private.
by Junior (705 points)
selected by
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,309 answers
105,023 users