Polimorphic function

Hi! I need to create Polimorphic function which takes abstract class as argument.

class Abstract{ //Абстрактный класс
public:virtual void print_msg()=0;
};
What is the problem?
i don't know how it made.

for exemple:

class Abstract{ //Абстрактный класс
public:virtual void print_msg()=0;
};

class A:public Abstract{
void_print_msg()
{
cout<<"Hello";
}
};
int main()
{
Here we mast create ibject of class A and for him we need to call polimorphic function..
}
1
2
3
4
void print(Abstract* )
{
    // do something
}
ok.. i made it
void print(Abstract* )
{
cout<<"Polimorphic function";
}

but how i can call it in main??

int main()
{
A a();
//I can't create object of abstract class and it is error if i write "print(a)"
}
i understood. it is my bag=)
i must write print(&a)
Thank you!
Topic archived. No new replies allowed.