I don't understand why the piece of code below returns me the error:
warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 3 has type ‘int *’ [-Wformat]
warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 3 has type ‘int *’ [-Wformat]
Code:
int *v=malloc(10*sizeof(int));
int i;
for(i=0;i<10;i++) v[i]=i;
for(i=0;i<10;i++) printf("v[i]=%+2d &v[i]=%#.10X |
* (v+i)=%+2d (v+i)=%#.10X\n",v[i],&v[i],*(v+i),(v+i));
Comment