void and bool

Is there a way i can make this function a boolean?

 
  void bool Pacman::CollisionCheck(int x1, int y1, int width1, int height1, int x2, int y2, int width2, int height2)
Remove the void at the beginning.
When i remove void, and i use this in a if statement i get the error "epression must have bool type or be convertible to bool
What is the expression?
Post any error message here, verbatim, along with any relevant parts of your code - that if-statement, for example.

http://www.cplusplus.com/forum/beginner/1/
http://www.catb.org/esr/faqs/smart-questions.html
Can't say much without your code but I would advise to check if your function is returning a Boolean value.

looking at the error you're getting it sounds like you're not returning a bool.

1
2
3
4
5
6
7
8
9
10
11
bool Pacman::CollisionCheck(int x1, int y1, int width1, int height1, int x2, int y2, int width2, int height2)
{
    bool status;

    statement;
    statement;
    statement;


    return status;
}
Last edited on
Topic archived. No new replies allowed.