#include #include #include #include bool **star42(int n) { bool **know = (bool **)malloc(n * sizeof(bool *)); for (int i = 0; i < n; i++) { know[i] = (bool *)malloc(n * sizeof(bool)); } for (int i = 0; i < n; i++) { if (i == 42) { continue; } for (int j = 0; j < n; j++) { if (i == j) { know[i][j] = false; } else if (j == 42) { know[i][j] = true; } else { know[i][j] = (rand()%2 == 0); } } } return know; } int main() { srand(time(NULL)); // initialise la seed de rand int n = 50; bool **know = star42(n); // printf("La star est : %d\n", star(know, n)); free(know); return EXIT_SUCCESS; }