My specific question is: how do I fix this problem:
the .moveup and .jumpup functions return a bool and the matrix is [int][int].
if(whitepiece[index].jumpup(xposition2, yposition2, matrix) == 0 && whitepiece[index].moveup(xposition2, yposition2, matrix == 0))
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\MYPROJECTS\SnSCheckers\main.cpp(173) : error C2664: 'moveup' : cannot convert parameter 3 from 'bool' to 'int '
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
And in general, when does one need to typecast?
Generally that sort of an error, pointer to integer, or integer to pointer, means you're passing the wrong thing to a function. Specifically, it means where you're supposed to be using an integer, you're using a pointer. In this case, it means you're doing something like this:
This is clearly wrong, because this function wants a two dimensional array, and you're simply passing it one integer. A cast would most definately be wrong here. The correct thing to do would be to pass it what it expects you to pass it, and not something incorrect.
void foo( int bar[SOMESIZE] );
foo( x );
caught my mistake, I just had a misplaced )
so I <i>was</i> passing it the right data type...