Advertisement
Guest User

detmatrix main.c

a guest
Feb 25th, 2012
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.70 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. // Include the functions to manipulate matrices
  6. #include "functions.h"
  7.  
  8.  
  9. // Height & With of the first matrice
  10. #define H1 3
  11. #define W1 3
  12.  
  13. int main(void) {
  14.   // To generate random numbers
  15.   srand (time (NULL));
  16.  
  17.   // Creation and filling of the first matrice
  18.   int **mat1 = init_matrice(H1, W1);
  19.   mat1 = fill_matrice(mat1, H1, W1);
  20.  
  21.   // Display the first matrice
  22.   display_matrice(mat1, H1, W1);
  23.   printf("\n");
  24.  
  25.   // création de la seconde matrice
  26.   int **mat2 = init_matrice2(2, 2);  
  27.   mat2 = new_matrice(mat1, W1, 1);
  28.  
  29.   // affiche la nouvelle matrice
  30.   display_matrice(mat2, 2, 2);
  31.   printf("\n");
  32.  
  33.   return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement