Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Conversion from a basic type to a class type may be
achieved using______________

Answer Posted / sujatha

Conversion from a basic type to a class type may be
achieved using SUITABLE CONSTRUCTORS IN CLASS.


EX:
class distance
{
int feet;
float inch;


public:

distance(float p) //costructor to concert basic type to
class type
{

feet= (int) p;
inch=(p-feet)*12;
}


void show()
{
cout<<"feet="<<feet;
cout<<"inch="<<inch;
}
};

void main()
{
distance d1=1.75;

d1.show();
}

out put

feet=1;
inch=9;

Is This Answer Correct ?    59 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is overriding in oops?

1057


• What are the desirable attributes for memory managment?

2167


what is the sylabus for priliminaries?

2122


Where You Can Use Interface in your Project

1835


What is difference between pop and oop?

1076


What is the purpose of polymorphism?

1084


What is the real time example of encapsulation?

1007


What is polymorphism in oops with example?

973


Prepare me a program for the animation of train

2412


What is encapsulation in oops?

958


What does and I oop mean in text?

1120


What is property in oops?

988


What does oop mean in snapchat?

1153


How do you define a class in oop?

1060


What is overriding in oop?

993