Advertisement
Guest User

Untitled

a guest
Sep 1st, 2021
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.65 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. #define LIGNE_TABLEAU 5
  6. #define COLONNE_TABLEAU 4
  7.  
  8. int *cree_tableau(void);
  9.  
  10.  
  11. int main(void)
  12. {
  13.     int i = 0, j = 0;
  14.    
  15.     //char *tableau = creeTableau();
  16.     int *tab = cree_tableau();
  17.  
  18.     for (int i = 0; i < 5; ++i)
  19.     {
  20.         for( j = 0; j < COLONNE_TABLEAU; j++)
  21.         {
  22.             printf("[%d] ",tab[i][j]);
  23.  
  24.         }
  25.     }
  26.     return 0;
  27.  
  28. }
  29.    
  30.  
  31.  
  32.  
  33.  
  34.  
  35. int *cree_tableau(void)
  36. {
  37.     int i =0, j = 0;
  38.     static int tableau_entier[LIGNE_TABLEAU][COLONNE_TABLEAU];
  39.  
  40.     for (int i = 0; i < 5; ++i)
  41.     {
  42.         for (int j = 0; j < COLONNE_TABLEAU; ++j)
  43.         {
  44.             tableau_entier[i][j] = i + j * 3;
  45.         }
  46.        
  47.     }
  48.  
  49.     return tableau_entier;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement