2012-02-26 7 views
0

2 차원 배열을 표시하려고합니다.2 차원 배열 표시

int arr[numRows][numCols] = {{0,1,2,3,4,5,6},{7,8,9,10,11,12,13},{14,15,16,17,18,19,20}}; 

void display(int p[][numCols]) 
{ 
     //printf("\n"); 
     for (int i = 0; i< numRows;i++) 
     { 
      for (int j = 0;i< numCols;j++) 
      { 
      printf("%i\t",p[i][j]); 
      } 
      printf("\n"); 
     } 
} 

그러나 몇 가지 오류 메시지가 표시됩니다. 해결 방법을 모르겠습니다.

enter image description here

화면 출력 : enter image description here

전체 코드는 여기에 있습니다 :

https://codereview.stackexchange.com/questions/9419/programming-of-3-x-7-trick

+0

어떻게 부르세요 ...? –

+0

님이 질문을 수정했습니다 .... – lakesh

답변

4

당신은 간단한 오식이 - 대신 :

for (int j = 0;i< numCols;j++) 

사용

for (int j = 0;j< numCols;j++)