What is the difference between a class and a structure in C++?
Answer / nashiinformaticssolutions
With the exception of member variables and methods' default accessibility setting, class and structure (or struct) are essentially the same in C++. They are configured as public in a structure and private in a class.
| Is This Answer Correct ? | 0 Yes | 0 No |
Can turbo c++ run c program?
why can't we declare data member of class auto register or extern
Is there any function that can skip certain number of characters present in the input stream?
What is the difference between structure and class?
What is long in c++?
Declare a class vehicle and make it an abstract data type.
What is anonymous object in c++?
Difference between linked list and array?
When do we use copy constructors?
State two differences between C and C++.
class Foo { const int x; protected: Foo(int f); ~Foo(); }; Foo f; Referring to the sample code above, why will the class declaration not compile? a) The variable x is const. b) The destructor is protected. c) The destructor is not public. d) The constructor is protected. e) There is no default constructor.
What is the need of a destructor? Explain with the help of an example.