Difference between Constructors and static constructors?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is called array?

624


What number of digits that can be accuratly stored in a float (based on the IEEE Standard 754)? a) 6 b) 38 c) An unlimited number

797


Write about the stack unwinding?

637


Should I learn c or c++ first?

578


Can a program run without main in c++?

594






What is the difference between strcpy() and strncpy()?

620


Write a program to find the Factorial of a number

585


What is a virtual destructor? Explain the use of it?

553


Can notepad ++ run c++?

556


How is c++ different from java?

571


When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?

582


What is a friend function in c++?

585


What is token c++?

592


What is fflush c++?

591


Name the debugging methods that are used to solve problems?

591