Hello,
Code:
#include <stdio.h>
int first (int(*q), int, int);
int second (int(*q)[4], int, int);
int main(){
int s[3][4]={1, 2, 3, 4,
5, 6, 7, 8,
9, 10, 11, 12};
first (s, 3, 4);
second (s, 3, 4);
return 0;
}
int first (int *q, int x, int y)
{
int i, j;
for (i=0; i<x; i++)
{
for (j=0; j<y; j++)
printf ("%d ", *(q+i*y+j));
printf ("\n");
}
printf ("\n");
return (*(q+i*y+j));
}
int second (int (*q)[4], int x, int y)
{
int i, j, *p;
for (i=0; i<x; i++)
{
p=q+i;
for (j=0; j<y; j++)
printf ("%d ", *(p+j));
printf ("\n");
}
return (*(p+j));
}
when i compile this code why it gives me bellow shown two warnings -
Warning W8075 array23.c 8: Suspicious pointer conversion in function main
Warning W8075 array23.c 29: Suspicious pointer conversing in function second
would you please explain about the printf ("%d ", *(q+i*y+j)); statement.