I apologize if this is not considered a good enough question (since my own solution just works, so I really have no problem), but here it goes. I mean, I was raised in C, and later I learned C ++, so maybe I am biased, but still.
In this particular case, there is one library that returns const char* , and another library needs the input void* . Therefore, if I want to call the second library with the result of the first, I will need to write
second(const_cast<void*>(static_cast<const void*>(first())));
Right? This is the only right way, right?
source share