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

How to make a form using Dreamweaver at my website?
By dragging/dropping form controls/template in DW tool will generate junk code, I would recommend to create by writing won code by which unwanted css/js files won't be create which will reduces effort in later stage.
Chetan
What is the structure of a C program?
A C program typically starts with preprocessor directives, followed by global variable declarations. It then defines functions, one of which must be the main() function, serving as the entry point. The...
Igno
0 0
5
how much i have to pay for share point training and certification.
Dear Jain, We do offer both SharePoint Design, Development and Administration training. We offer exclusive training along with interview assistance. We charge 15K for SharePoint Development...
Jain
0 0
6

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

Ask a Question

Related Lessons

PowerPivot For Excel
PowerPivot is an add-in for Microsoft Excel 2010 that enables you to import millions of rows of data from multiple data sources into a single Excel workbook, create relationships between heterogeneous...

Angular-2 Developer Training Program Syllabus
Angular2 Developer Training Program Syllabus: Introduction to Angular2. Why Angular2. Angular2 Features: Components, Services and Typescript. Angular2 Components: Templates, Modules, Services...

Wait Handler implementation in WebDriver
public void waitForElementPresence(By by) { Wait<WebDriver> wait = new WebDriverWait(driver, GLOBAL_TIME_OUT); wait.until(ExpectedConditions.presenceOfElementLocated(by)); } ...

How Motivation Affects Learning and Behavior
Motivation directs behavior toward particular goals. Motivation leads to increased effort and energy. Motivation increases the amount of effort and energy that learners expend in activities directly...

Lesson: Hive Queries
Lesson: Hive Queries This lesson will cover the following topics: Simple selects ? selecting columns Simple selects – selecting rows Creating new columns Hive Functions In SQL, of which...

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