Hi, I have mentioned below some changes u can do to run the code successfully :
1. Change the prototype of the function
from : [COLOR=Red]void display(int (*)[4], int , int);[/COLOR]
to : [COLOR=Blue]void display(int *, int , int);[/COLOR]
since u r sending the base address of the integer 2d array which will be catched by the integer pointer then no need to specify size in the function prototype...
2. If u r not returning any value as it seems the coding u have done for function main() then change it
from : [COLOR=Red]int main()[/COLOR]
to : [COLOR=Blue]void main()[/COLOR]
otherwise it will give a warning message.
3. In function display() change the code
from : [COLOR=Red]p = ptr + i;[/COLOR]
to : [COLOR=Blue]p = *(ptr + i);[/COLOR]
Make the above changes n u will get the result properly...if u have any further queries pl mention...



LinkBack URL
About LinkBacks




Bookmarks