your indentation style is very hard to follow...
You have one missing } because of it
Code:void new_board(char b1[][21], char b2[][21]) { int i, j, p; for (i=0; i<20; i++) { for (j=0; j<20; j++) { p=neighbours(i,j); if(b1[i][j]=='*') { if(p==2||p==3) { b2[i][j] = '*'; } else { b2[i][j] = '.'; } } //missing else { if (neighbours == 3) { b2[i][j] = '*'; /* b2 corresponding position gets a '*' */ } else { b2[i][j] = '.'; /*b2 gets a '.' */ } } } } /* b2[i][j] = '\0'; ----assign ????? \0 */ }