so here is my code:
#include
main(){
int hi;
hi = 3;
printf(\"%d\",&hi);
}
and the output is: \"2686748\"
im using
If you intend to print the value of hi
, just pass it to printf, not its address:
printf("%d", hi);
You may be confusing printf
with scanf
, the latter requiring all of its arguments to be pointers.
The "%d"
tells the printf
you are putting in an integer. The integer you are giving it is &hi
which is the address of hi
. If you want the value of hi
just use that