Conversion from a basic type to a class type may be
achieved using______________
Answer Posted / mohit swami
"constructor"
for example:
class time
{
int hrs;
public:
time(int t) //constructor
{
hrs=t/60;
}
};
void main()
{
time T1; // object T1 is created
int duration=85;
T1=duration; //int to class type
}
| Is This Answer Correct ? | 9 Yes | 3 No |
Post New Answer View All Answers
What is difference between pop and oop?
explain sub-type and sub class? atleast u have differ it into 4 points?
What is the difference between inheritance and polymorphism?
What is overloading and its types?
How can you overcome the diamond problem in inheritance?
What is the significance of classes in oop?
What is polymorphism and example?
What is oops concept with example?
What are the 3 principles of oop?
Who invented oop?
Why is static class not inherited?
Why do we use polymorphism in oops?
What is object in oop?
can inline function declare in private part of class?
what are the realtime excercises in C++?