"Return" Code Not Working I'm trying to experiment with a "return" function. Yet each time I try to run my program, there happens to be an error, like "expected declaration before '}' token."

Can someone explain the basics of a return function, and look at my code below to possibly see what the problem could be?

{
int index;

pinMode(10, INPUT); //button input

int checkInput();

if (digitalRead(10) == 0) {

return 1;
else{

return 0;
 }
}
It has nothing to do with the retun statements. You have to close each { with a }. you are missing one.  

   {
int index;

pinMode(10, INPUT); //button input

int checkInput();

if (digitalRead(10) == 0) {

return 1;}
else{

return 0;
 }
}