#include <stdio.h>
int main(void)
{
int i = 3;
int* j = &i;
printf("%u",j);
}
The above code should print out the address (an unsigned integer) of memory block in which integer 3 is contained. But instead I am getting this error-
error: format specifies type 'unsigned int' but the argument has type 'int *'
.
I confirmed from various sources that:
1. *j
refers to "value at address stored in j"
2. &j
refers to address of memory block in which pointer j is stored.
3. j contains an unsigned int value which is the address of memory block at which j is pointing.