I am trying to compile this program without warning,
#include<stdio.h>
int main()
{
int arr[] = {1,2,3};
printf("value1 = %d value2 %d\n", *(&arr+1), *(arr+1));//here is the warning
return 0;
}
But I am getting a compile time warning
warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int *’ [-Wformat]
I am compiling my program on a 64 bit ubuntu machine gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) compiler.