I have a problem with this code:
main :
#include <stdio.h>
#include <stdlib.h>
#include "Function.h"
int main()
{
int B[9];
saisie_B_M(&B[9]);
return 0;
}
Function.c
void saisie_B_M(int B[9])
{
int i;
for(i=0; i<8; i++)
{
printf("Une cellule morte ayant %d voisins sera t-elle morte ou vivante à la génération suivante ? \n", i);
scanf("%d", &B[i]);
}
}
function.h
#ifndef Function_H_INCLUDED
#define Function_H_INCLUDED
void saisie_B_M(int B[9]);
#endif // Function_H_INCLUDED
The principle is simple, it is an array of 9 and I just return a value in each cell of the table. But there is a bug at the end and I don't know why the compiler does not show a message.
saisie(B)