#include <iostream>
using namespace std;

class A {
       A()        {cout << "nuovo A" <<  endl; };
       void virtual f()=0;
       void g() {cout << "g di A" << endl; }

class B: public A {
       B()        {cout << "nuovo B" <<  endl; };
       void f()  {cout << "f di B" << endl; }
       void g() {cout << "g di B" << endl; }


class C: public A {
      C()	   {cout << "nuovo C" <<  endl; };
      void f()  {cout << "f di C" <<  endl; }
      void g() {cout << "g di C" << endl; }

class D: public C {
      D()	        {cout << "nuovo D" <<  endl; };
      void f(int x) {cout << x <<  endl; }

int main() {
    A* vet[3];
    vet[0]= new B;
    vet[1]= new C;
    vet[2]= new D;
    for (int j=0; j<3; j++) {
If I understood right, when I use virtual function I'm referencing to pointed object.
vet[2] is A* pointer while the pointed object is D class one.
Class base is A, D is derived from C, C is derived to A.
A is abstract class because f is virtual function, so It's virtual both in all its derived class.
OK my observations?

so vet[2]->f() should call D::f but this doesn't occur because function wants a parameter and we pass any ones, so what's logic to invoke right function? It's chose the function of one of derived classes where correspond number and type of parameters ?
I think this one the only missing piece to understand virtual functions.
Thanks again.