Errors:

How can I pass constants into a function. I tried using ' ' but that also gave me error, so I removed them here.

Why does it say cell undeclared?

Code:

#include<stdio.h>
#define MAX 80
void generate(int cell[], MAX);
void printArray(int cell[], MAX);
/*generate: current condition-->next generation
printArray: print 1 as *, 0 as <spacei>*/
int main(void)
{
int cell[MAX]={0}, n, gen, i;
printf("Enter starting location and number of generations: ");
scanf("%d %d", &n, &gen);
cell[n]=1;
printArray(cell, MAX);
for(i=2;i<=gen; i++)
{
generate(cell, MAX);
printArray(cell, MAX);
}
return 0;
}
void generate(int cell[], MAX){
int n=0;
for (n=0; n<MAX; n++)
if(!((cell[n+1]) && (cell[n-1])) && ((cell[n+1]) || (cell[n-1])))
cell[n]=1;
return;
}
void printArray(int cell[], MAX){
int n;
for (n=0; n<MAX; n++)
if (cell[n]=1) printf ("*");
if (cell[n]=0) printf (" ");
else printf("!");
printf("\n");
return;
}