Problem with functions and auton

I don’t know how to code very well in vexcode. I am having a problem with functions an auton.
Please help me with the code problems because I cant function HAHAHAH under this pressure. The competition is coming up in two weeks and I don’t have an auton.


function definition is not allowed here.

Do you know where function definitions are allowed?

Here are a few tips regarding functions based on what you have posted. When the console says “function definition not allowed here” This generally means you defined (or wrote) a function inside of another. Try to keep your functions separate and above thee “int main” . Second when you call a function there must be no space between the name and parentheses Ex. DRIVE(100, 200); this should work for you. Every thing else seems great. Nice use of parameters in your function.

The top of the code is cropped, but from what I can tell your DRIVE function is inside of another function.

1 Like

Sorry my bad forgot c++ isn’t whitespace sensitive language. Ignore the whole “no space between the drive function”.

Could you point out where exaclty the mistake is at?

Your DRIVE function is inside another function, which usually isn’t allowed. It needs to be outside of any function in order to be declared
That curly brace told @Omerktosi that your function is inside another. Try placing it right above the pre-auton function, and make sure it isn’t within any other functions…