Interviewer And Interviewee Guide

C++ Access Control Interview Question:

Can you please explain the difference between struct and class in terms of Access Modifier?

Submitted by: Administrator
Classes and structures are syntactically similar. In C++, the role of the structure was expanded, making it an nalternative way to specify a class. In C, the structures include data members, in C++ they are expanded to have function members as well. This makes structures in C++ and classes to be virtually same. The only difference between a C++ struct and a class is that, by default all the struct members are public while by default class members are private.
Submitted by: Administrator

Read Online C++ Access Control Job Interview Questions And Answers
Copyright 2007-2025 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.