Help with code?

I was just testing a few functions to make a battleship game, but I keep getting this error:
client.cpp:22:29: error: expected ')'
void printBoard(char [][10] array) {
                            ^
client.cpp:22:16: note: to match this '('
void printBoard(char [][10] array) {
               ^
client.cpp:25:12: error: use of undeclared identifier 'array'
                        cout << array[i][j];
                                ^
2 errors generated.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
using namespace std;

void fillBoard(char, char [][10]);
void printBoard(char [][10]);

int main() {
	char board[20][10];
	fillBoard(254, board);
}

void fillBoard(char c, char array[][10]) {
	char fill = c;

	for(int i = 0; i < 20; ++i) {
		for(int j = 0; j < 10; ++j) {
			array[i][j] = c;
		}
	}
}

void printBoard(char [][10] array) {
	for(int i = 0; i < 20; ++i) {
		for(int j = 0; j < 10; ++j) {
			cout << array[i][j];
		}
		cout << endl;
	}
}


The above functions just fill a board with solid squares (ascii code) and then print it. The print function is giving me the error.
Maybe you're tired and need rest. You are no seeing something very obvious.

22
23
void printBoard(char array[][10]) {
// void printBoard(char [][10] array) { 

...
Thanks
Are you using Visual Studio? I know I can't name an array "array" because VS thinks array is a keyword.

http://stackoverflow.com/questions/372580/why-is-array-a-reserved-word-in-c-c
I am coding on a Mac with an app called CodeRunner, a text editor with a built-in console. Array does not show up as a keyword.

http://krillapps.com/coderunner/
Topic archived. No new replies allowed.