March 22nd, 2013, 02:52 AM
don't say I don't accept anything because I didn't say I don't accept something,
that is just what you say.
the code doesn't need to be changed since it's working in a 32-bit system or at least for me,
since it doesn't involve another datatype than INT, and is not the point of this topic at all.
so if you say that it won't work in x64 that is offtopic, because you just can make
some minnor changes and get that to work for you. so why you get offtopic saying
this won't work on x64?
what I wanted to point out is the use of typecasting in basic variables so they work
as pointer variables.
I made no assumption at all.
I understand that the 10 variables are not trusted to be stored contiguously,
but remember, I relied on an "implementation detail", so as you see there was no
assumption, but a pure fact. The fact is, it works for me indeed so I can show my point,
which has nothing to do with x32 or x64 systems, data storage, and so ...
If this code doesn't work for you, still you can get the point of the topic by
reading the source code. If you want more, you can make it work for you with just
point: "typecasting in basic variables so they work as pointer variables".
why you keep telling other kind of things?
by saying this, you just shown me you have not the minimal idea of what is going on in my code, since you lack the static variables initialization value, and your pointer variable is not static either. so as you see you have failed big there.
Originally Posted by Paul McKenzie
anyways, I will took that as some kind of attempt of getting this thread to be a bit funnier
#include<windows.h>//or just stdlib.h
static int x=0;
static int y=0;
static int* z = &x + 1;
if ( z == &y )
std::cout << " OK\n";
std::cout << "Not OK\n";
Last edited by eightyfive; March 22nd, 2013 at 03:25 AM.
Click Here to Expand Forum to Full Width