Casting Pointers in C++
Assuming we have 2 simple classes like this:
then, if I want to cast a pointer to
I always end up with a constant pointer to
I believe it's because it's not allowed to do this on a constant pointer. Is it really like that?
Another question is, is there a way to cast a pointer to a non-constant pointer in UE?
Please note that I want to do safe-casting. So direct casting like this (ordinary C++ style):
is not preferable, because I don't know if it will cause run-time error, if the casting failed, or if it will be casted to a pointer with invalid memory address. In other words, it might be more difficult to handle problems with ordinary C++ style casting.
But, if that's the only way, then I'll just have to accept it.
asked Aug 24 '16 at 12:34 PM in C++ Programming
Sorry, my mistake. I accidentally declared the function parameter to be
answered Aug 24 '16 at 12:42 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here