WARNING:
1. assignment makes a pointer from Integer without a cast.
2. passing arg1 of 'display' from incompatible pointer type.
Could anybody help me to give solution to this warning. It will be better if you guide why im not getting the expected output.
Below I place the error code. If u have to see my whole program for better checking it go to http://paste.pocoo.org/show/250129/
Compiled in gcc..
Expand|Select|Wrap|Line Numbers
- #include<stdio.h>
- #include<stdlib.h>
- void display();
- int main()
- {
- int *a[3][3],i,j;
- for(i=0;i<3;i++)
- {
- for(j=0;j<3;j++)
- a[i][j]=0;
- }
- a[1][1]=1; //this is where I get the first warning
- display(&a); //and the second warning is this
- return 0;
- }
- void display(int *p)
- {
- int *a[3][3],i,j;
- for(i=0;i<3;i++)
- {
- for(j=0;j<3;j++)
- {
- a[i][j]=*p;
- p++;
- printf("%d\t",a[i][j]);
- }
- printf("\n");
- }
- }