-2
2D 행렬을 사용해야하지만 일부 할당 후에는 모든 것이 잘못되었습니다. 기본적으로 지침입니다. X 및 Y는 2 변수 함수임을2D 행렬에 값 할당
test0 :0
test1 :0
test2 :0
test3 :0
test4 :-1
test5 :-1
test6 :3
test7 :3
참고
int matA[1][1], matB[1][7], matRes[1][7];
memset (matA, 0, sizeof (matA));
memset (matB, 0, sizeof (matB));
memset (matRes, 0, sizeof (matRes));
printf("test0 :%d \n",matB[1][0]);
//matrice de fonction
matB[1][0]= 0;
printf("test1 :%d \n",matB[1][0]);
matB[1][1]= matB[0][2]= matB[0][3]= 0;
printf("test2 :%d \n",matB[1][0]);
matB[0][0]= matB[0][4]= matB[0][6]= matB[1][2]= matB[1][4]= matB[1][5]= 1;
printf("test3 :%d \n",matB[1][0]);
matB[0][1]= matB[0][5]= matB[0][7]= matB[1][3]= matB[1][6]= matB[1][7]= -1;
printf("test4 :%d \n",matB[1][0]);
//matrice d'entrée
matA[0][1]= matA[1][0] = 0;
printf("test5 :%d \n",matB[1][0]);
matA[0][0]= X;
printf("test6 :%d \n",matB[1][0]);
matA[1][1]= Y;
printf("test7 :%d \n",matB[1][0]);
출력 :
여기서 코드이다.
정확한 제목. –
'int matA [1] [1]'은 1 행렬입니다. 그게 네가 정말로 원하는거야? –
탭이 0으로 초기화됩니까? 0321 [0] [0] [1] –