Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Type casting with 2 base classes in C++

#include<iostream.h>
#include<conio.h>
class meter
{
float length;
public:
meter()
{length=0.0; }
meter(float initlength)
{length=initlength/100.0;
}
void show()
{cout<<"length in meter:"<<length;
}
};
void main()
{
clrscr();
meter meter1;
float len1;
cout<<"enter the length in cm";
cin>>len1;
meter1=len1;
//cout<<"Length in cms:"<<len1;
meter1.show();
getch();
}