| | |
How I can implement Swap Arays function??
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2008
Posts: 11
Reputation:
Solved Threads: 0
C++ Syntax (Toggle Plain Text)
#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???// }
•
•
Join Date: Oct 2008
Posts: 25
Reputation:
Solved Threads: 0
C++ Syntax (Toggle Plain Text)
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; } }
•
•
Join Date: Oct 2008
Posts: 25
Reputation:
Solved Threads: 0
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;
}
}
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
{
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;
}
}
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
![]() |
Other Threads in the C++ Forum
- Previous Thread: Please HELP!!!!!!
- Next Thread: Classes help on getting stockcount
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll download dynamiccharacterarray email encryption error file forms fstream function functions game generator getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





