This topic is now archived and is closed to further replies.


This is technicly impossible right?

Recommended Posts

I'm having a slight problem with my compiler. With the following statement if( (Temp->Thing)==this) continue; Even if Temp->Thing is the same value as 'this' the if statement still fails. I should say that Temp->Thing is a void pointer and 'this' is well a pointer to a class, could this be a problem :S? EDIT: Just tried typcasting Temp->Thing to the same type as 'this'... still doesn't work EDIT2: It appears to be a problem with the 'this' pointer. Looking at the following code in the debugger void *this_thing=(void*)this; After the set operations this_thing IS NOT EQUAL to 'this'!. SO I'm presuming that C++ automatically typcasts 'this' in the if statement to void therefore it no longer equals it anyway... So does anyone know how I can make it typecast without changing it's value? EDIT3: Okay it seems that it's purely to do with the this pointer. Doing CGUIPlayer *Player=this //this is of type CGUIPlayer also gives me a wrong value. [edited by - RamboBones on May 3, 2003 4:27:00 AM]

Share this post

Link to post
Share on other sites