FUNCTIONS, CONSTRUCTOR, DESTRUCTOR & OVERLOADING QUESTIONS IN C++. (9)

Observe the following C++ code and answer the questions (i) and (ii).
Note Assume all necessary header files are already being included in the program:

class Salary
{
int Empld,DeptCode;
public:
Salary(int Eld); //Funciton1
Salary(); //Function2
Salary(Salary &S); //Function3
void Input(); //Function4
void Output(); //Function5
};
void main()
{
Salary S(25); //Statement1
}

(i) Which of the following will get executed, when the Statement1 is executed in the above code?
(ii) Write a statement to declare a new object L with reference to already existing object S using Function3.



No comments

Post your comments

Powered by Blogger.