How to solve this error for this part :=>warning: control reaches end of non-void function [-Wreturn-type]
bool Rover::move(Map &mars) { char Heading[] = {'^', '>', 'v', '<'}; switch (heading) { case 0: if (mapper.isHill(x, y+1)) { cout << "cant move" << endl; return false; } if(mapper.isTrap(x, y+1)){ mapper.setObject(x, y, ' '); y += 1; mapper.setObject(x, y, 164); system("cls"); mapper.display(); break; } if(!mapper.isInsideMap(x, y+1)){ cout << "hitting a wall"<< endl; return false; } else{ mapper.setObject(x, y, ' '); y += 1; mapper.setObject(x, y, Heading[heading]); collectgold(mars); return true; } case 1: if (mapper.isHill(x+1, y)) { cout << "cant move" << endl; return false; } if(mapper.isTrap(x+1, y)){ mapper.setObject(x, y, ' '); x += 1; mapper.setObject(x, y, 164); system("cls"); mapper.display(); break; } if(!mapper.isInsideMap(x+1, y)){ cout << "hitting a wall"<< endl; return false; } else{ mapper.setObject(x, y, ' '); x += 1; mapper.setObject(x, y, Heading[heading]); collectgold(mars); return true; } case 2: if (mapper.isHill(x, y-1)) { cout << "cant move" << endl; return false; } if(mapper.isTrap(x, y-1)){ mapper.setObject(x, y, ' '); y -= 1; mapper.setObject(x, y, 164); system("cls"); mapper.display(); break; } if(!mapper.isInsideMap(x, y-1)){ cout << "hitting a wall"<< endl; return false; }