2차원 동적배열
-
2차원 동적배열 생성, 초기화, 복사@ 16. 1 ~ 17. 1/C++ 2013. 2. 24. 22:21
#include #include using namespace std; void end(int **star, int row); void print(int **star, int row, int col); void copys(int **star, int (*ptr)[2], int row, int col); int main() { int row=5; int col=2; int (*ptr)[2]; int sample[5][2]={{1,2},{2,3},{3,4},{4,5},{5,6}}; int **twostar=new int*[row]; ptr=sample; for(int i=0;i