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

How to avoid a class from instantiation?

8 Answers   Symphony,


What do you mean by vtable and vptr in c++?

0 Answers  


Is std :: string immutable?

0 Answers  


What are the different types of polymorphism?

3 Answers  


What does the following code do: int c=0; cout< a) Undefined *Updated* b) 01 c) 00

0 Answers  






When one must use recursion function? Mention what happens when recursion functions are declared inline?

0 Answers  


Any one help me plzzzz..... i have an assignment...... that is ______*********_______ Write a program that takes an equation as a string and does the following: Solve 8 parts to achieve 100% 1 - 5 are compulsory. Input: 2x^2+3x+4=0 1) read a quadratic equation 2) print its coefficients (coefficients range is 0 to 9) 3) print the solution of the equation 4) tackle imaginary solution e.g. ( (2+3i), (2-3i) ) 5) allow spaces within the input 6) after solving one equation; ask for an other, terminate on empty line. * 7) tackle negative values as well * 8) tackle more than one values of same exponent (e.g. 2x^2 + 3x^2 + 4x + 3 = 0)* 9) use strtok * 10) print the solution in fractions e.g. 1.5 should be printed as (1)1/2 * 11) coefficient can be greater than 9** 12) values on both sides of the ‘=’ sign** 13) plot the graph of the polynomial** 14) use a compiler other than Borland** 15) submit before May 25, 2009 11:59 PM ** _______******________ plz send me c++ code at sweety.alvi@gmail.com

1 Answers  


What is the most useful programming language?

0 Answers  


How do I start a c++ project?

0 Answers  


how to access grid view row?

0 Answers  


What is a "RTTI"?

6 Answers   HCL,


Explain what is oop?

0 Answers  


Categories