Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Linear Algebra and the C Language/a0ee

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

__NOTOC__ Install and compile this file in your working directory. /* ------------------------------------ */ /* Save as : c00c.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ int main(void) { double **A = i_mR( R3, C5 ); double **B = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]); clrscrn(); printf("A[%d][%d]:",rsize_R(A),csize_R(A)); p_mR(A, S4,P0,C7); printf("B[%d][%d]:",rsize_R(B),csize_R(B)); p_mR(B, S4,P0,C7); stop(); f_mR(A); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ You can use the function i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]);, if you want a new matrix with the same size than A. You read the size of A directly into memory. I will give an explanation of this code when we study the code of the i_mR(); function. Screen output example: A[3][5]: +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 B[3][5]: +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 Press return to continue.