if that code only generates a warning, then you must be using C. In C++ that code should not compile at all, because you are trying to assign a value of type "int" to a variable of type "int*" without explicitly telling the compiler that you mean to do so.
This is also a nice example of how dangerous printf can be, since it doesn't lend itself to type checking in C or C++.
Code:
int* ptr;
int var = 1;
// here, ptr points to var, which has the value 1;
// however, ptr itself does NOT have the value 1
ptr = &var;
// so, we can say this:
assert(*ptr == 1);
assert(ptr == &var);
// but we CANNOT say this:
assert(ptr == 1);
// and then if we say this:
var = 5;
// we can still say:
assert(*ptr == var);
Code:
// BY THE WAY: don't bother trying this one in a compiler;
// it will most likely crash, because ptr is not valid
int* ptr;
int var = 1;
// here, ptr receives the value of var, but ptr does
// not point to var
ptr = var;
// we can say this:
assert(ptr == var);
// but we can't say this:
assert(*ptr == var);
// and if we say this:
var = 5;
// then we can now say this:
assert(ptr == 1 && var == 5);
assert(*ptr != var);
assert(ptr != var);
// but we can't say this:
assert(ptr == var);
assert(*ptr == var);