i'm new learning C, and learning pointer right now,i study from this website, but this code give me an error : pointer.c: In function ‘main’: pointer.c:6:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int *’ [-Wformat=] printf("Address: %d",&var); //Notice, the ampersand(&) before var.
i compile it with : gcc -o pointer pointer.c
/* Example to demonstrate use of reference operator in C programming. */
#include <stdio.h>
int main(){
int var = 5;
printf("Value: %d\n",var);
printf("Address: %d",&var); //Notice, the ampersand(&) before var.
return 0;
}