把基类指针安全地转换为派生类指针,并在类型不符时得到 nullptr,应使用?

C++

  1. A.static_cast
  2. B.reinterpret_cast
  3. C.C 风格强转
  4. D.dynamic_cast