C++ Questions

Q:

Define Structure in C++.?

Answer

The C++ programming technique allows defining user defined datatypes through structure. The


syntax to declare structure is as follows:


struct student


{


char name[100]


char address[250]


};

Report Error

View answer Workspace Report Error Discuss

Subject: C++

0 1933
Q:

What is default constructor?

Answer


A default constructor is a constructor that either has no parameters, or if it has parameters, all the parameters have default values.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

0 1911
Q:

what is the use of virtual destructor in c++?

Answer

A destructor is automatically called when the object is destroyed. A virtual destructor in C++ is used primarily to prevent resource leaks by performing a clean-up of the object.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

0 1836