This doesn't work and the problem is the only type names I'm guaranteed to have are jobject and jarray. The original _jobject is how it's defined here but I'm not guaranteed it''ll always be that way so I have to work with jobject/jarray.Code:(I am not the one who defined these classes) class _jobject {}; class _jarray : public _jobject {}; typedef _jobject* jobject; typedef _jarray* jarray; int main() { jobject * a; jarray b; a = dynamic_cast<jobject*> (&b); .... }
This works at runtime:
So why doesn't the dynamic cast?Code:jobject a; jarray b; a = ( jobject ) b;
How would I cast between jobject and jarray (and other types if coming in, I only know it's of type <some_sub-Type>?



LinkBack URL
About LinkBacks




CornedBee