The declaration should be
void getMove( int move, int space)
{
<snippet>
}
if you want to pass the whole array as a parameter then it should be:
void getMove( int move, int space[] )
{
<snippet>
}
Aia
Nearly a Posting Maven
2,392 posts since Dec 2006
Reputation Points: 2,224
Solved Threads: 218
int space [] is in effect the same as int *space, you can use one instead of another.
Sorry, but the two are not interchangeable.int space [] causes illegal syntax error message (VC++ 2005 Express compiler.). Unless that is something new in C99 standards, which very few compilers support yet.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
int space [].
That syntax is ok when declared as a parameter to a function, but not when declaring an object within the body of a function. I may (probably) misinterpreted your post.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343