#include <stdio.h>
#define SIZE 3
void swaparrays(int* a, int* b);
 main ()
{
      int a[3][3]={{0, 2, 3},
                   {1, 5, 7},
                   {3, 9, 4}};
                  
      int b[3][3]={{2, 8, 5},
                   {4, 7, 1},
                   {3, 9, 2}};
}
                   
void swaparrays(int* , int* );
{     
  //How I can impement swap arrays Function???//
}

Recommended Answers

All 2 Replies

void swaparrays(int* a, int* b);
{     
int temp;
for (int i =1 , i=3, i++)
{
for (int j=1, j=2, j++)
{ 
temp = a[i][j];
a[i][j]=b[i][j];
b[i][j]=temp;
} 
}

void swaparrays(int* a, int* b);
{
int temp;
for (int i =1 , i=3, i++)
{
for (int j=1, j=2, j++)
{
temp = a[j];
a[j]=b[j];
b[j]=temp;
}
}

I'm sorry here is a mestake
for (int i=1, i<=3, i++)
and
foe (int j=1, j<=3, j++)
also even better to use defined earlier in programm SIZE for condition of the for loop

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.