unable to get function to print to Serial

Here is my code :

int set[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int num[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
char keys[11] = "0000000000";

void setup() { 
  Serial.begin(9600);
  
  for(int i = 3;i < 13;i++){
    pinMode(i, INPUT);
    digitalWrite(i, LOW);
  }
}

void loop() {    
  for (int i = 3; i < 13; i++) {
    
    if(digitalRead(i) == HIGH){
      keys[i-3] = '1';
    }
    else{
      keys[i-3] = '0';
    }
    
    if((digitalRead(i) == HIGH) && (set[i-3] == 0)){
      keymap(keys);
      set[i-3] = 1;
    }
      
    if(digitalRead(i) == LOW){
      set[i-3] = 0;
    }
  }
}

void keymap(char key[11]){
  if(key == "1000000000"){
    Serial.println('0');
  }
  if(key == "0000000000"){
    Serial.println("error");
  }
}

My problem comes when I call keymap. I have tested and know that the value of keys in loop() is getting set correctly when I press a button. But the Serail.println command is not executing in void keymap(). Any ideas of how to correct this.

I would like to have a separate file such as a class or something that contains all possible values for keys and prints to the Serial the corresponding value. I tried making a library but failed at that because I could not get a return from a void function.

Thanks for your help.

if(key == "1000000000"){
    Serial.println('0');
  }

Of course it doesn't print. That's not how you compare strings. That will always return false because you are comparing the memory address of key with the memory address of a constant string. Since they obviously aren't the same memory address the if statement always goes false and the print never happens.

Try strcmp.

Delta_G thanks for pointing that out. After looking up how to use strcmp I modified the code for all 10 buttons and it works. Thanks again. Being able to have this part of the code separate from void loop makes it easier to edit and control. After all, mathematically i can have up to 169 buttons with just using 10 inputs.