Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

(C++: )What are the ways to store a pointer of one type into a pointer variable for another type?

user-image
Question added by Rana Alnajjar , Web developer , Lebcards
Date Posted: 2015/06/03
Rehan Farooq
by Rehan Farooq , WEB DEVELOPER/DIGITAL MARKETING EXPERT , Upwork

Direct assignment (if the pointer types are implicitly convertible, such as with derived to base, non-const to const, or any to void), or assignment after a cast.  Depending on the combination of types, any of the four C++ casts (static_cast, const_cast, dynamic_cast, or reinterpret_cast) may be suitable.

More Questions Like This