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
How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?
What is an accessor in c++?
What does h mean in maths?
What is a literal in c++?
Can I run c program in turbo c++?
What is the hardest coding language to learn?
What is c++ vb?
What is ofstream c++?
Why namespace is used in c++?
Is c++ harder than java?
When there is a global variable and local variable with the same name, how will you access the global variable?
How does the copy constructor differ from the assignment operator (=)?
How would you use the functions randomize() and random()?
What are arithmetic operators?
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