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

Answer Posted / rsn

Hello Shivani,

I think both struct and class in C++ are quite the same
except for the fact that, members in struct are public by
default whereas they are private for class.
Moreover struct also supports inheritance,polymorphism
etc...etc...

Is This Answer Correct ?    14 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an iterator class in c++?

598


How long will it take to learn programming?

586


What is c++ runtime?

651


what is C++ exceptional handling?

627


Can I learn c++ without c?

601






Which operations are permitted on pointers?

566


Is c++ proprietary?

579


What can c++ be used for?

578


What is the latest version on c++?

681


What are the uses of c++ in the real world?

562


Is turbo c++ free?

619


What is function prototyping? What are its advantages?

591


List the advantages of inheritance.

640


What is c++ code?

582


what are the iterator and generic algorithms.

1687