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
Why is "using namespace std;" considered bad practice?
What is the benefit of c++?
What are c++ templates used for?
What happens if a pointer is deleted twice?
How does com provide language transparency?
what are Access specifiers in C++ class? What are the types?
What is #include math h in c++?
How many namespaces are there in c++?
What is null pointer and void pointer?
Which operator cannot overload?
Differentiate between realloc() and free().
Difference between an inspector and a mutator
Write is a binary search tree? Write an algo and tell complexity?
What is #include ctype h in c++?
Difference between pointer to constant and constant pointer to a constant. Give example.