The error I got:
[Warning] passing arg 1 of `(my function)' from incompatible pointer type
I tried to get my function to read 3 things. I already declared my void function. I already created char* board, char* vehicle, char* distance in my function.
it is in int main()
moveCar(&board, &vehicle, &distance);
it doesn't run my program correctly. What can I do to make it to work smooth?
Updated:
since some of you guys want to take a look at my function. here it is.
void moveCar(char* board[], char* vehicle, char* direction)
{
int i;
for (i = 0; i < size; i++)
{
if(board[i] = vehicle)
{
if(*direction = 'r')
{
if(*board[i + 1] = '.')
{
swap(board, (&i), (&i + 1));
}
}
else if (*direction = 'l')
{
if(*board[i - 1] = '.')
{
swap(board, (&i), (&i - 1));
}
}
else if (*direction = 'd')
{
if(*board[i + 8] = '.')
{
swap(board, (&i), (&i + 8));
}
}
else if(*direction = 'u')
{
if(*board[i - 8] = '.')
{
swap(board, (&i), (&i - 8));
}
}
}
}
}
my_functionis actually a function pointer (and I'm guessing it isn't), it should not be in brackets. - ablighboardetc.? If they're strings, you leave off the&- EOFmy function(whatever it is). - Lee Duhem