What is the difference between Class and Structure?

Answer Posted / eshetu

1. IN STRUCTURE THE DATA MEMBER BY DEFAULT IS PUBLIC BUT IN
CLASS THE DATA MEMBER ARE PRIVATE.
2. THE STRUCTURE ONLY CONTAIN DATA MEMBER BUT CLASS CONTAIN
DATA MEMBER & MEMBER FUNCTION.
3.IN STRUCTURE THE STRUCTURE NAME CAN'T STAND ALONE.BUT THE
CLASS NAME CAN STAND ALONE.

Is This Answer Correct ?    10 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the uses of typedef in a program?

616


What is tellg () in c++?

728


Is c++ a low level language?

519


Does c++ have finally?

571


Distinguish between a # include and #define.

653






What is the benefit of c++?

605


Given the following seqment of code containing a group of nested if instructions: y = 9; if ((x==3) || (x == 5)) y++; else if (x == 2) y *= 2; else if (x == ) y-= 7; else y = 8; if the value of x is 4 before the nested IFs are executed, what is the value of y after the nested IFs are executed?

1590


How does class accomplish data hiding in c++?

662


Write a program which uses functions like strcmp(), strcpy()? etc

623


Explain selection sorting?

644


Which is best ide for c++?

572


What is the oldest programming language?

575


What is the return value of the insertion operator?

608


What is class invariant in c++?

750


What is srand c++?

585