Case Switch Variable Initializing Problem

I need help with my programming I am trying to write a switch case command. I have my two variables as 0 and 1. i need each branch to execute an action when it recieves these messages. I am having issues with it telling the difference and trying to initalize the variables. Can anybody help me please?

switch(value)
{
  case 0:;
     int value = 0;
      lcd.setCursor(0, 1);
      lcd.print("O.O");
      break;
 switch(value)      
case 1 :
    int value = 1;
      lcd.setCursor(0, 1);
      lcd.print("Hi! :)");
      break;
      }

int value = 1;

This both declares the existence of the variable "value" and gives it a value.

Within one block of { and }, you can only have one variable called "value". You can't declare a "new copy" of the value because then how would you know which one you wanted to use? It's like parents of identical twins giving them both the same name. But the family in the next house over, they could have a kid with the same name and there would be no confusion.

But you also refer to another variable called "value" in the expression switch(value) This would be the kid in the other house, because it's outside the {}.

What are you trying to do here? If value is 1, then you don't need to set it to 1 again.

I have it receiving a message of 0 or 1. When it receives it, it will preform an action. I tried to separate those with case 1 and case 0. How else would I write it to do what I want?

switch (value)
{
  case 0:
    lcd.setCursor(0, 1);
    lcd.print("O.O");
  break;
  case 1:
    lcd.setCursor(0, 1);
    lcd.print("Hi! :)");
  break;
}

Thank You, but I have run into the same problem as before. The error that pops up is " 'value' was not declared in this scope". How do I declare 'value'

Anywhere outside of the switch case statement.