#include #include #define NOMBRE_VALEURS 6 #define NOMBRE_LIGNES 4 #define NOMBRE_COLONNES 3 void main(void) { srand(10); double tab1[NOMBRE_VALEURS]; int tab2[NOMBRE_LIGNES][NOMBRE_COLONNES]; for (int i = 0; i < NOMBRE_VALEURS; i++) { tab1[i] = (rand() % 101) / 100.0; } for (int i = 0; i < NOMBRE_VALEURS; i++) { printf("%p : %6.2lf\n", &tab1[i], tab1[i]); } printf("\n"); double* p1 = tab1; printf("%p %p\n", tab1, p1); for (int i = 0; i < NOMBRE_VALEURS; i++) { printf("%p : %6.2lf\n", p1, *p1); p1++; } for (int l = 0; l < NOMBRE_LIGNES; l++) { for (int c = 0; c < NOMBRE_COLONNES; c++) { tab2[l][c] = rand() % 10; } } printf("\n"); for (int l = 0; l < NOMBRE_LIGNES; l++) { for (int c = 0; c < NOMBRE_COLONNES; c++) { printf("%p : %2d ", &tab2[l][c], tab2[l][c]); } printf("\n"); } printf("\n"); int* p2 = &tab2[0][0]; printf("%p %p\n", tab2, p2); for (int i = 0; i < NOMBRE_LIGNES * NOMBRE_COLONNES; i++) { printf("%p : %2d\n", p2, *p2); p2++; } }