What are the differences between a struct in C and in C++?
Answers were Sorted based on User's Feedback
Answer / anoop chaurasiya
c structure does not support the concept of data hiding but
in approach of c++ class support the concept of data hiding.
| Is This Answer Correct ? | 17 Yes | 5 No |
Answer / 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 |
Answer / shakti singh khinchi
In C, structures does not support "virtual" mechanism like
virtual functions whereas C++ structures supports virtual
mechanism like classes.
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / jyoti
C++ was based on C and retains a great deal of the
functionality. C++ does not retain complete source-level
compatability with C. There are a few gotchas for C++
programmers trying to write C code, and C programmers trying
to compile with a C++ compiler.
| Is This Answer Correct ? | 8 Yes | 8 No |
Answer / nithin
what is the use of struct in c then? wat advantages does it
offer?
| Is This Answer Correct ? | 1 Yes | 8 No |
What is size of empty class object
In a class only declaration of the function is there but defintion is not there then what is that function?
What is an orthogonal base class in c++?
What is a breakpoint?
What do you mean by public protected and private in c++?
Why is it called c++?
Why is "using namespace std;" considered bad practice?
I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.
Difference between Overloading and Overriding?
35 Answers Appnetix Techno, GameLoft, HP, IBM, NIIT, Rohde and Schwarz,
What does it mean to declare a member function as static?
What is stoi in c++?
What is the difference between #import and #include?