x

Choose Country Code

x

Direction

x

Ask a Question

  • Ask a Question
  • Scan a Question
  • Post MCQ
  • Note: File extension must be of jpg, jpeg, png, bmp format and file size must not exceed 5 MB
x

Ask a Question

x

x
x
x
Hire a Tutor

Answers and Solutions

What's Your Question?
Answer
Class: 1. Class is a reference type and its object is created on Heap memory. 2. Class can inherit the another class. 3. Class can have constructor and destructor of all types. 4. The member variable can be initialized directly. Structure: 1. Structure is a value type that is why its object is created on Stack memory. 2. Structure does not support the inheritance and cannot inherit another class. 3. Structure can only have the parametrized constructor. it means a structure can not have the non-parametrized constructor,default constructor and destructor also. 4. The member variable cannot be initialized directly.
Answer
Class is a collection of different data member and member function where as structure is a collection of different data types only
Answer

Hy Nagendar, the class provide the flexiblity of combining the data and method toghether and also provide reusablity called inheritance, while stucture is used to grouping data of different type

Answer

Hi Nagendra,

you want to know about the C++ structure or C structure?

Post Answer and Earn Credit Points

Get 5 credit points for each correct answer. The best one gets 25 in all.

Post Answer