*ptrvehicles[nextarraypos()]->setwheels(4);
ptrvehicles is an array of pointers.
ptrvehicles[nextarraypos()] is a pointer
-> would dereference the pointer and call the setwheels() method
* try to dereference whatever setwheels() returns. But it returns void, hence the error.
Thankyou ne555, Removing the * did solve the problem and it makes sense now that you explained it like that. My brain can't handle pointers to pointers too well.