| | |
How I can implement Swap Arays function??
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
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
Views: 347 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file format forms fstream function functions game generator getline givemetehcodez graph iamthwee ifstream image input int java lib loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sort sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





