the const char*msg in D::print is the value of the const char* in B::print, because initially, the base pointer is calling the function?
Yes.
The key to understanding this is to remember that the default argument is picked during compilation, while the function is picked at run time.