horrible, sneaky ways around cast

Started by
21 comments, last by Sneftel 20 years, 10 months ago
civguy: that was VERY sneaky.. i didnt see it at all till i looked hard enough.

-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

-eldee;another space monkey;[ Forced Evolution Studios ]
Advertisement
I like MichaelT''s the best...but why the %x? That''s in hex...but its cool to see the original number- you feel good about yourself.

Brian J
Brian J
void* intToVoidPtr(int* i)
{
union U
{
int* _i;
void* _p;
};

U u;
u._i = i;

return u._p;
}


int main(int argc, char* argv[])
{
int i = 0;
int j = 0;

printf("&i=%i\n&j=%i\n", intToVoidPtr(&i), intToVoidPtr(&j));

return 0;
}

this will output:

&i=1245056
&j=1245052

these locations will ofcource change every time you start the program.

This topic is closed to new replies.

Advertisement