Question 97Asked in BPSC TRE 2.0 (2023) Computer Science Class 11-12

All members of a structure in C++ are _____ by default.

  1. Apublic
  2. Bprivate
  3. Cprotected
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) public

Explanation

In C++, members of a struct are public by default, and so is struct inheritance. This is the main difference from a class.

From BPSC TRE 2.0 (2023) Computer Science Class 11-12 — Previous Year Paper

This is question 97 of BPSC TRE 2.0 (2023) Computer Science Class 11-12 — Previous Year Paper. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.