first of all, this is one of my first times writing code so I'm a newb.
I'm writing for the nds using devkit pro, and so its all written in c++. I want to have a menu, each menu screen is a void, and I need to have a way to go back to the previous menu.
Also, I made sure that on the actual code, there is NO syntax errors (unless not being declared in this scope is considered a syntax error).
How can I do this without getting the "Error 'settings' was not declared in this scope". Code:
//Headers go here
void controls()
{
//Inits and what not go here
if (key_press & key_down)
/*This is generally how you say if the down key has been pressed (This syntax might be wrong, but ignore that part)*/
{
settings(); //This part doesn't work because it can't read back in the code
}
}
void settings()
{
//Inits and what not go here
if (key_press & key_down)
{
controls();
}
}
void mainMenu()
{
//Inits and what not go here
if (key_press & key_down)
{
settings();
}
}
AND NOTE, somewhere outside of this code, mainMenu() would get activated. So does anyone know how to code this correctly?
Thanks in advance.