Can u tell the Difference between struct and class in C++? OR why struct is value type and class is reference type? Note : Dont say syntax difference

Asked by Last Modified  

4 Answers

Follow 0
Answer

Please enter your answer

Software Professional Trainer with 26+ years of Experience in Software Design and Development

In C++ struct all the members(member variables and member functions) are public by default. In C++ class all the members(member variables and member functions) are private by default; value type means there will be two memory location, in reference there is no new memory location. Both variable...
read more
In C++ struct all the members(member variables and member functions) are public by default. In C++ class all the members(member variables and member functions) are private by default; value type means there will be two memory location, in reference there is no new memory location. Both variable will be same. read less
Comments

B.Tech(Information Technology) Diploma(Information Technology)

refrence not take memory while struct take memory strut will not use inheritance class will use it
Comments

16 Yrs of Experience in Teaching

Area of datamembers and datafunctions in struct are by default public , while class having private, Storage of struct and class are different heap and stack so..
Comments

IT Professional Trainer with 15 years of experience in IT Industry

In C++, a structure is same as class except the following differences: 1) Members of a class are private by default and members of struct are public by default. 2) When deriving a struct from a class/struct, default access-specifier for a base class/struct is public. And when deriving a class,...
read more
In C++, a structure is same as class except the following differences: 1) Members of a class are private by default and members of struct are public by default. 2) When deriving a struct from a class/struct, default access-specifier for a base class/struct is public. And when deriving a class, default access specifier is private. read less
Comments

View 2 more Answers

Related Questions

What are the employment opportunities for Graphic Designing?
Graphic Designing has a vast range of scope in different aspect. You can go with Ad agencies, E-learning companies, design studios, TV channels, Events management, print media companies and many more.
Shweta
VBA Training institutes in Bangalore?
Yes we are providing training of VBA. CBK Infotech India pvt Ltd, near MSREC Road, Infron of Biriani House. Mathikere Bangalore
Lekhnath Bhandari
HI, i need to know about SAP ABAP HR or SAP HR ABAP
well do SAP ABAP HANA version 7.5 and sap hr hana with successfactor and if u want urgent job then do sap hana hr payroll
Priya
Where should we implement the DOM Manipulation in Angularjs ?
To manipulate the DOM we have directives in Angular JS like ng-show, ng-hide etc. Basically a directive is used to generate the dynamic content i.e., HTML at run time.
S.V.R
0 0
6
How can I learn Arduino language?
You can learn Arduino by using tinkercad website ,there you will get whole physical level as well as coding concept from there.
Priyajit
0 0
9

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

SOME SOFTWARE TESTING INTERVIEW QUESTIONS
These are some top questions asked in Software Testing Interview. Q1) What is risk-based testing?A) Risk-based testing is the term used for an approach to creating a test strategy that is based...
I

Icreative Solution

0 0
0

Anything could be understood, if learned in proper way, and by good coach.
Anything could be understood, if learned in proper way, and by good coach. Every body has there own way and pace of grasping things, so mentor/coach should be in sync (neither too fast nor too slow) with...

doWhile example in Java
public class doWhilePracticleEx { public void test() { } public static void main(String args) { String q1 = "Who is PM of India?"; String a1 = "Sonia Gandhi"; String a2 = "Rahul Gandhi"; String a3...
S

Sarthak C.

0 0
0

What Is Phython?
Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by GuidovanRossum during 1985- 1990. Like Perl, Python source code is also available...

Hidden Gems Of MS Excel - Sort (add Multiple Levels to Sort Data)
Please refer following dataset: You would know:- To Sort Month from Oldest → Newest OR Newest → OldestOR- To Sort Region from A → Z OR Z → AOR- To Sort Units Sold from Smallest →...

Recommended Articles

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Looking for IT Courses ?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you