Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ error two or more data types in declaration of function

Tags:

c++

In a piece of code I am passing two parameters both of same type b2Vec2 *

void bool isVelocityAllowToCar(b2Vec2 *newVelocity, b2Vec2 *preVelocity);

When I build my project it showing me following error.

two or more data types in declaration of 'isVelocityAllowToCar'

What am I doing wrong?

like image 943
Dhiral Pandya Avatar asked Oct 26 '13 16:10

Dhiral Pandya


1 Answers

The problem is the return type you specify. void bool is not valid, it's two types void and bool. You just need to remove the void and it should work:

bool isVelocityAllowToCar(b2Vec2 *newVelocity,b2Vec2 *preVelocity);
like image 67
Daniel Frey Avatar answered Sep 21 '22 10:09

Daniel Frey