|
// 이예제에서 ??? 부분을 어케 처리해야하나요..??
#include <iostream>
using namespace std;
??????? Add( int (*x)[2], int (*y)[2] )
{
static int temp[2][2];
for( int i = 0; i < 2; i++){
for(int j = 0; j < 2; j++)
temp[i][j] = x[i][j] + y[i][j];
}
return temp;
}
void main()
{
int a[2][2] = {1, 2, 3 ,4};
int b[2][2] = {2, 3 ,4, 5};
int temp[2][2] = Add(a, b);
cout << temp[0][0] << " " << temp[0][1] << endl;
cout << temp[1][0] << " " << temp[1][1] << endl;
}
// 2차원배열을 전달인자로 가질수는 있겠는데 리턴하는 방법은 없나요..?
// 이것저것 다해봤는데 몰겠습니다.. 도와주세여~~~
|