Instead of cout<<"Subscriber tipo G->"<<"Name blog: "<<((Blog *)b).GetName()<<endl; do writefln("Subscriber tipo G->", "Name blog: ", ((Blog *)b).GetName());