i attempted to find information about whether virtual function determine throughout compilation or while running. while searching i discovered something as dynamic connecting/late binding however i did not understand whether it implies that the function itself determine throughout compilation prior to the executable or throughout the executable.

can someone please explain?

For virtual functions resolution is performed at runtime. If you have a clear case of an item the resolution which approach to call is famous only if this program is running since at runtime you realize the precise kind of this instance. For non-virtual functions this resolution can be achieved at compile time since it is known that only this process could be known as there can't be child classes overriding it. Also this is exactly why virtual method calls are a little reduced (absolutely negligibly but reduced than non-virtual method calls). This article describes the idea in additional particulars.

Usually virtual functions are resolved throughout runtime. The reason why are apparent: you typically have no idea what actual object is going to be known as in the call site.

Base *x;  Derived *y;
Call1(y); 

void Call1(Base *ptr)
{
   ptr->virtual_member();
     // will it be Base::virtual_member or Derived::virtual_member ?
     //runtime resolution needed
}

Such situation, when it is not obvious what function is going to be known as in the certain host to code, and just in runtime it's really determined, is known as late binding.

However, in some cases, you may have heard the function you are likely to call. For instance, if you do not call by pointer:

Base x;  Derived y;
Call2(y); 
void Call2(Base ptr)
{
   ptr.virtual_member();
     // It will always be Base::virtual_member even if Derived is passed!
     //No dynamic binding necessary
}

The title research, overload resolution and access look into the virtual function call happens at compile amount of time in the 'static' kind of the item saying used to invoke the virtual function call (i.e when the object expression is of type pointer or perhaps a mention of the a polymorphic base class).

The particular function known as at run time however is dependent around the dynamic kind of the item expression pointed to through the base class pointer or reference.