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

Answer Posted / amit patel

Rsn answer is perfect write.Shivani you are wrong.
the visiblity of members default public in structure,
whereas in class its private as all know.
So please don't make myths here.

for the detail answer for explanation read the following link.

http://carcino.gen.nz/tech/cpp/struct_vs_class.php

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are arrays c++?

606


What is meant by const_cast?

648


What's the hardest coding language?

574


What is vectorial capacity?

646


What do you mean by friend class & friend function in c++?

620






What is a base class?

600


Write a program in C++ for Fibonacci series

659


Does c++ vector allocate memory?

530


Is std :: string immutable?

561


Why do we use structure in c++?

572


How do you differentiate between overloading the prefix and postfix increments?

586


How do you show the declaration of a virtual constructor?

527


Give the difference between the type casting and automatic type conversion. Also tell a suitable C++ code to illustrate both.

628


Can a Structure contain a Pointer to itself?

608


What are the types of container classes?

614