I have two classes a
Код: Выделить всё
Parent
Код: Выделить всё
Child
Код: Выделить всё
Parent
Код: Выделить всё
Child**
Код: Выделить всё
Parent**
Код: Выделить всё
reinterpret_cast
Or such thing is not possible
Below is a minimal example. I am wondering is that code correct or
Код: Выделить всё
Child**
Код: Выделить всё
Parent**
NB: my question is on the conversion of the pointer of pointer. I.e. is this line correct ?
Код: Выделить всё
Parent** ptrToChildPtr = reinterpret_cast(&childPtr);
Many thanks in advance
Код: Выделить всё
#include
#include
class Parent {
public:
Parent() {}
virtual ~Parent() {
std::cout
Источник: [url]https://stackoverflow.com/questions/78131924/reinterpret-cast-for-pointer-of-pointer[/url]