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

Answer Posted / shakti singh khinchi

In C, structures never support constructors and destructors
whereas C++ supports both of them.

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between realloc() and free().

767


Differentiate between a copy constructor and an overloaded assignment operator.

841


If horse and bird inherit virtual public from animal, do their constructors initialize the animal constructor? If pegasus inherits from both horse and bird, how does it initialize animal’s constructor?

895


Why null pointer is used?

776


Describe the advantages of operator overloading?

768


What is atoi?

732


Will this c++ program execute or not?

791


What is the need of a destructor? Explain with the help of an example.

788


What is operators in c++?

779


What is meant by the term name mangling in c++?

716


Will rust take over c++?

791


Which c++ operator cannot overload?

739


In the derived class, which data member of the base class are visible?

861


Differences between private, protected and public and give examples.

764


Is c++ primer good for beginners?

780