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
some changes.
point: "typecasting in basic variables so they work as pointer variables".
why you keep telling other kind of things?
EDIT:
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.
http://img259.imageshack.us/img259/5...uareowned1.png
anyways, I will took that as some kind of attempt of getting this thread to be a bit funnierCode:#include<windows.h>//or just stdlib.h
#include<stdio.h>
#include <iostream>
int main(){
static int x=0;
static int y=0;
static int* z = &x + 1;
printf("%X\n",&x);
printf("%X\n",&y);
printf("%X\n",z);
system("pause");
if ( z == &y )
std::cout << " OK\n";
else
std::cout << "Not OK\n";
system("pause");
return 0;
}