UrbanPro

Learn C++ Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is the difference between class and structure?

Asked by Last Modified  

Follow 0
Answer

Please enter your answer

Tutor

Basic difference between class and structure is that Structures are used to store data and a class defined both data and the functions that access that data.
Comments

Software professional with 7 years experience

There is only one difference, by default all members are public in a structure where in class members are private.
Comments

Computer Programming

In class all members by default private.but in case of structure by default public. In structure we can not initialize the members . Structure not support polymorphism, inheritance
Comments

IT Technical Trainer

In C++, class and structure are both identical except the accessibility of the members (data or methods). In class, accessibility is private by default and in structure it is public by default. All other features are same.
Comments

B. Sc. MAths (H) and B. Tech(Computer S.) from JMI New Delhi

By default the members of structure are public where as class members are private by default.
Comments

1) structure :- In structure have a by default public. In class have a by default private. 2) Structure cannot be inherited. But class can be inherit. 3) There is no data hiding features comes with structures. Classes do, private, protected and public. 4) A structure can't be abstract, a class...
read more
1) structure :- In structure have a by default public. In class have a by default private. 2) Structure cannot be inherited. But class can be inherit. 3) There is no data hiding features comes with structures. Classes do, private, protected and public. 4) A structure can't be abstract, a class can. 5) A structure is a value type, while a class is a reference type. 6) A structure is contain only data member , but class contain data member and member function. 7) In a Structure we can't initilse the value to the variable but in class variable we assign the values. read less
Comments

Class is a reference type and structure is a value type.
Comments

Class is a reference type and stored on a heap. Structure is a value type and stored on a stack.
Comments

View 6 more Answers

Related Questions

I would like to be part of UrbanPro as a tutor
Follow below steps : 1. You are already registered with Thinkvidhya. 2. Pick up good plan starts with 500/- plan. 3. Which can help you to reach to students who are interested to get coaching from you....
Sreepa
Is C++ is next version of C?
This feature looks pretty sweet. This would be great because you wouldn't need getters any more. You could make member variables public; later, if you change your mind, you can turn them into property.
Subham
What are the toughest topics in C language?
1. pointer 2. dynamic memory allocation 3. File handling
Lokayya
0 0
5
Are C Programmers currently in demand?
Ofcourse, C is alwasy in demand. In the beginning a lot of the big project developed in C language. Now a days, there are a lot of language in market and speciallity is growing in IT field. For a big organization...
Harsha
Is there any person who can teach me C++ without Money Fees?
Good question :) Free training is available on various sites online. But, if you would want to learn from an expert directly, there's a very slim chance that you might find some one who will teach for...
Kishan

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

Ask a Question

Related Lessons

How are C And C++ Different Form Each Other
1.C and C++ both have data types operator and conditional looping control statements. But the difference is that C++ has to object-oriented concepts which C programs do not have. Hence C program is like...

Memory Layout of C Programs
A typical memory representation of C program consists of following sections. Text Segment: A text segment, also known as a code segment or simply as text, is one of the sections of a program in an object...

Why we need to learn Programming languages?
Language is medium for communication. If two parties like to communicate or exchange the thoughts they must know a language. Language should be understandable by both the Parties. For example A wants to...

Data Structure: Searching
Searching Searching means finding an element in an array. There are two type of searching techniques : Linear Search Binary Search In linear search, to find the element array is traversed and...

Set 0 To Kth Bit In A Variable
The following code snippet Set 0 to Kth Bit in an variable #include int UnsetBitValue(int n, int k);int main(){ printf("%d\n\n",UnsetBitValue(255,6)); return 0;}// Set kth bit to zeroint UnsetBitValue(int...

Recommended Articles

Introduction C++ is an excellent programming language and many of the applications are written in C++ language. It has generic, object-oriented & imperative programming features, and also provides facilities for low-level memory manipulation. Successor of C language, it is an OOP (object oriented programming) language...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

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 >

Looking for C++ Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C++ Language Classes?

The best tutors for C++ Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C++ Language with the Best Tutors

The best Tutors for C++ Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more