So I’m attempting to make a function for my program to drive a certain number of centimeters using the rotateFor command and I have everything defined but im getting an error that says

*15:48:43 – error – error: function definition is not allowed here
void DriveforCm (double DistanceCM, char y) {
^*

Why am I getting this error to make the function? Any help would be appreciated

Here’s my code

```
void DriveforCm (double DistanceCM, int veloc) {
//Define variables
double wheelDiameterCM = 10.16;
double travelTargetCM = DistanceCM; //Wil determine how far the robot goes
//Calc wheel circumferance
double circumference = wheelDiameterCM * M_PI;
double degreesToRotate = (360 * travelTargetCM) / circumference; //All calculations are complete. Start the rest of the program.
//Set the velocity of the left and right motor
LeftDrive.setVelocity(veloc, vex::velocityUnits::pct);
RightDrive.setVelocity(veloc, vex::velocityUnits::pct);
//Rotate the Left and Right Motor for degreesToRotate.
LeftDrive.rotateFor(degreesToRotate, vex::rotationUnits::deg);
RightDrive.rotateFor(degreesToRotate, vex::rotationUnits::deg);
//Stop motors after reached CM distance
LeftDrive.stop
RightDrive.stop
}
```