What are the differences between a struct and a class in
C++?

Answer Posted / ajit

In structures by default the member variables considered as
public where as in classes by default data members are
considered as private.
Structures doesn't provide the concept data encapsulation
but classes provides it.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you sort a sort function in c++ to sort in descending order?

547


what is the difference between linear list linked representaion and linked representation? what is the purpose of representing the linear list in linked represention ? is it not avoiding rules of linear represention?

1744


Explain some examples of operator overloading?

637


Explain deep copy and a shallow copy?

598


Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?

3692






What is pointer to array in c++?

608


When one must use recursion function? Mention what happens when recursion functions are declared inline?

637


What is c++ redistributable?

613


Program to check whether a word is a sub-string or not of a string typed

1588


Do you know the problem with overriding functions?

563


How is c++ used in the real world?

565


What are the differences between new and malloc?

623


What is a terminating character in c++?

756


What is the difference between a pointer and a link in c ++?

558


Can we make copy constructor private in c++?

588