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
Which is better turbo c++ or dev c++?
How much do c++ programmers make?
What is the best c++ book for beginners?
Where are setjmp and longjmp used in c++?
Which bit wise operator is suitable for checking whether a particular bit is on or off?
Why do we need function?
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
Which field is used in c++?
What is vector string in c++?
Is c++ a good beginners programming language?
Write about the use of the virtual destructor?
What is :: operator in c++?
Will rust take over c++?
What are the operators in c++?
How does a copy constructor differs from an overloaded assignment operator?