storing address as a value
i am stuck with this one..this is what i have coded...
Code:
int main() {
int *var_a = malloc(sizeof(int));
int *var_b = malloc(sizeof(int));
int *var_c = NULL;
*var_b = 13;
*var_a = (int)var_b;
var_c = (int *)(*var_a);
printf("%d\n\n", *var_c);
return 0;
}
this code is giving two warnings when run on Visual Studio 2003...
the problem is that i want to store an address as an integer value!!
for e.g a pointer points to a location 0x12345
i want to store this location as an integer value in the 'value of' a pointer..
i.e. i want to store 0x12345 in *(ptr)
is there any way this can be done..