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 to get the current position of the file pointer?
Define basic type of variable used for a different condition in C++?
What does it mean to declare a member variable as static?
What is object oriented programming (oop)?
What is istream c++?
Who was the creator of c++?
Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02
What is a down cast?
A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a saleperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows: Item Value A 239.99 B 129.75 C 99.95 D 350.89 Write a program that inputs one salesperson's items sold in a week (how many of item A? of item B? etc.) and calculates and displays that salesperson's earnings for that week.
Difference between a homogeneous and a heterogeneous container
What is a constructor in c++ with example?
Can create new c++ operators?
Which compiler does turbo c++ use?
What is general format for a prototype?
What is c++ try block?