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

Which is better turbo c++ or dev c++?

567


How much do c++ programmers make?

566


What is the best c++ book for beginners?

578


Where are setjmp and longjmp used in c++?

626


Which bit wise operator is suitable for checking whether a particular bit is on or off?

607






Why do we need function?

603


In int main(int argc, char *argv[]) what is argv[0] a) The first argument passed into the program b) The program name c) You can't define main like that

617


Which field is used in c++?

640


What is vector string in c++?

578


Is c++ a good beginners programming language?

584


Write about the use of the virtual destructor?

612


What is :: operator in c++?

582


Will rust take over c++?

598


What are the operators in c++?

599


How does a copy constructor differs from an overloaded assignment operator?

558