Simply define a size of the array in the function header like this void someFunc(int buff[3][2]) and make a call to the function with another two dimensional array.void add(int swap[3][2], int swap2[3][2]) /* Function definition */
{
{
{
{
int temp,i;
for (i=0; i<3; i++)
{
temp = swap[i][0];swap[i][0] = swap[i][1];swap[i][1] = temp;
}}void display(int array[3][2],int array2[3][2] ) /* Function definition */
return;
{
int count=0,count1=0;
for (count=0;count<3;count++)
for (count1=0;count1<2;count1++)
printf("%d ", array[count][count1]);
printf("\n");}int main()
puts("");
{
int i[3][2]= { {1,2}, {3,4}, {5,6} };}Read more: Codeproject
display(i,i); /* i is a pointer */
add(i,i);
display(i,i);
return 0;
0 comments:
Post a Comment