I am not able to solve 3 error . Programs implementation is right but not sure how to get rid of 3 errors
# include <iostream.h>
# include < conio.h>
void main() {
class coord {
float x;
float y;
//Constructor
coord(float init_x,float init_y) {
x= init_x;
y= init_y;
}
void set(float f1, float f2) {
x = f1;
y = f2;
}
float get_x() {return x;}
float get_y() {return y;}
virtual void plot() {
cout<<x;
cout<<y;
};
class 3d_coord: public coord {
float z;
//constructor
3d_coord(float init_x,float init_y,float init_z): coord(init_x,init_y) {
z= init_z;
}
void set(float f1,float f2,float f3) {
coord::set(f1, f2); z = f3;
}
float get_z() { return z; }
virtual void plot() {
coord::plot();
cout<<z;
};
int test
void *ptr;
cin>>test;
coord a(1.1, 2.2);
3d_coord b(3.0, 4.0, 5.0);
if (test)
ptr = &a;
else
ptr = &b;
ptr-> plot();
}
}