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

what is method over-riding and how it is used ? if possible send with code with output or screen photo ?
Method over-riding : it is a technique in which more then one function with same name and same signature( similar type parameter) can present in program. in overriding a subclass method overrides the definition...
Sayyad
0 0
5
Is C#, C++, Python, or JS better for game development?
All languages good for gamjng. But you can make 3d games in c# uaing unity software and it's very very interesting to work on it.
Mohit
0 0
6
What is called 'nested loops' in C++?
These are those loops in which one loop executes inside another loop. For example for loop for(int i=1,i=10,i++) { for(int j=1, j<=i,j++) { } } the second loop is the nested for loop.
Harikrishnan
Explain about member functions?
Member functions are part of the class, member functions are used to access, member variable in private, protected, public area and also call another member functions.
Zeeshan
0 0
5
Is C/C++ language is still important in 2019?
Of course, C language is only the heart of any processor or controller.Because of complexity in C peoples are looking to work on High-level languages like JAVA etc.
Tejas
0 0
7

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

Ask a Question

Related Lessons

C++ Overview
Introduction: C++ is the first object oriented programming language used universally as an advanced version of C language. Many features such as Inheritance, Class & Object, Polymorphism(Function...
N

Namrata Y.

0 0
0

All About Programming And A Good Programmer.
Hi, This is my first lesson for you guys. Hope you enjoy reading it. In recent community questions, I found many people wanted to be good programmers, or wanted to have good hands on certain language,...

What is Abstraction?
In theortical terms, abstraction is: Hiding details from the outer world. Providing only essential details to outer world. C++ provide ways to hide details using access specifiers: public, protected...

My first C++ program
# include using namespace std; int main() { cout<<"Welcome to C++"; return 0; } Use IDE such as CodeBlocks to run this program. To do this, open CodeBlocks, Goto File->New->Empty File. Copy...

Why Indexing Should Start From Zero In Array ?
Why numbering should start at zero? To denote the subsequence of natural numbers 2, 3, ..., 12 without the pernicious three dots, fourconventions are open to usa) 2 ≤ i < 13b) 1 < i ≤ 12c)...

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