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 structures and classes in C++?

Asked by Last Modified  

Follow 0
Answer

Please enter your answer

Member of a class defined with the keyword class are private by default. Members of a class defined with the keywords struct or union are public by default. In absence of an access-specifier for a base class, public is assumed when the derived class is declared struct and private is assumed when the...
read more
Member of a class defined with the keyword class are private by default. Members of a class defined with the keywords struct or union are public by default. In absence of an access-specifier for a base class, public is assumed when the derived class is declared struct and private is assumed when the class is declared class. read less
Comments

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

In C++ Structure members are public by default. If you want to make it private, you need to mention private: and mention variable under private: Class members are private by default. You need to specifically mention public keyword, those are the members under public: keyword become public.
Comments

Mainly the default access specifier For struct By default members are public For class By default members are private
Comments

Chemistry / Computer Science Teacher

1) Structure :- Structures are by default public. Classes are 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...
read more
1) Structure :- Structures are by default public. Classes are 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 contains only data member , but class contains data member and member function. 7) In a Structure we can't initialize the value to the variable but in class variable we can assign the values. 8) Structures are value type, They are stored as a stack on memory. where as classes are reference type. They are stored as heap on memory. read less
Comments

View 2 more Answers

Related Questions

how to use dos.h
First include dos.h header file then use their function. Before use function, you must have knowledge of dos functions and their charactistics
Aman
What is the actual size of INT in the C language, 2 or 4 bytes?
The actual size to int is determined by the compiler as the program runs. But theoretically the size is 2 bytes. You can increase the size by adding keyword long infront of it to make the size 4 bytes. Eg int a; // 2 bytes Long int b; // 4 bytes
Kunal
What is difference between object oriented procedure and object oriented programming?
i.basic building block for procedure orientation is functions while for OOPS its objects.. ii.pop follows top-down hierarchy while opps its just opposite. iii.pop lacks encapsualtion and has acesses...
Madhuranjan
What are the toughest topics in C language?
1. pointer 2. dynamic memory allocation 3. File handling
Lokayya
0 0
5
What is C++
A high-level programming language developed by Bjarne Stroustrup at Bell Labs. C++ adds object-oriented features to its predecessor, C. C++ is one of the most popular programming language for graphical...
Shoaib

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

Ask a Question

Related Lessons

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...

Understanding Computer Science Concepts with Images and Videos..
All Computer science concepts relating to programming and software development are only virtual. It cannot be practically shown as a hardware parts of a computer. But for better understanding it should...

Advantages of C++ Language
Advantages of C++ - C++ is a profoundly convenient dialect and is frequently the dialect of decision for multi-gadget, multi-stage application advancement. - C++ is a protest situated programming dialect...

Compiler vs Interpreter
Compiler Interpreter Convert all the code into binary format and execute. Convert one statement at a time and execute, then Convert next statement and execute. After conversion, source...

C++ Program-Single Dimension Array
/* WAP to print sum and largest value in a single dimension array*/ //Header files #include<iostream.h>#include<conio.h> //Main function void main(){ //Array declaration int num,i,sum,large;...

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 >

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 >

Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...

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 >

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