Difference between Constructors and static constructors?

Answers were Sorted based on User's Feedback



Difference between Constructors and static constructors? ..

Answer / nayer plame

In C++ the difference is: static constructor do not exist in
C++ and constructors do exist

Is This Answer Correct ?    7 Yes 1 No

Difference between Constructors and static constructors? ..

Answer / venkataramakrishna. danduri

The main thing is the constructoe can't be Static, int or
any other data type. It will simpley throws a error
messgae. It is just to confuse the candidate.

Example:
class A
{
public:
static A(){ a = 0;}
int a;
};

void main()
{
A a;
}

Is This Answer Correct ?    2 Yes 0 No

Difference between Constructors and static constructors? ..

Answer / ganagdhara c

the normal constructor is use to initialize the data elements of the objects which are either static are non static elements where as thee static constructors are use to initialize the static data elements in the class these static data elements are shared by all the objects of the class type these are created when the first object of the class type was created.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More C++ General Interview Questions

What is the history of c++?

0 Answers  


Should the member functions which are made public in the base class be hidden?

0 Answers  


Write a code/algo to find the frequency of each element in an array?

0 Answers   Axtria,


What is a singleton class c++?

0 Answers  


what are the iterator and generic algorithms.

0 Answers  






What is the type of this pointer in c++?

0 Answers  


What is string in c++ programming?

0 Answers  


What is low level language in simple words?

0 Answers  


What is the use of namespace std in C++?

0 Answers   Hexaware,


What is a linked list in c++?

0 Answers  


What is the output of the following 3D Array int arr[3][2][2]={1,2,3,4,5,6,7,8,9,10,11,12}; what is the output for arr[2][1][0]?

6 Answers   HCL, Integra, IPMC, ORG,


Can I run c program in turbo c++?

0 Answers  


Categories