What is the difference between Class and Structure?

Answer Posted / sudip das.

The difference between a CLASS and STRUCTURE are that:
1) CLASS are reference type where as STRUCTURE are value type.
2)By default,all of the members of a CLASS are private, but all of the members of a STRUCTURE are public.
3)CLASSES use heap but STRUCTURE use stuck.
4)CLASS members can be declared as protected but STRUCTURE members can not be.
5)CLASS contain data members and member function, but a STRUCTURE is contain only data member.

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why should we use null or zero in a program?

608


Will the following program execute?

565


What is an inclusion guard?

625


What is do..while loops structure?

622


Is java easier than c++?

595






Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?

614


What is the difference between #import and #include?

555


What is a manipulative person?

547


What is abstraction in c++?

684


Define what is constructor?

590


What is #include ctype h in c++?

669


What is virtual destructor ans explain its use?

608


Is oops and c++ same?

581


How much is c++ certification?

591


the first character in the variable name must be an a) special symbol b) number c) alphabet

611