not getting expected output

hi, I wrote a code that sets the values of a few arrays and then compares them but it seems to not be working correctly, I expected the code to print "false password" because I set the buttons[] to 0 and the passTrue to 1, and so the comparing function (CheckPass) should output "false password", instead I am getting am infinite line of "÷". any help would be appreciated. below is my code.

int i;
int passTrue[9];
int buttons[] {};

int * SetButtons() {
  for (int i = 1; i<=9; ++i) {
    buttons[i] = digitalRead(i);
return buttons;
 }
}     


void setup() {
  Serial.begin(9600);
  pinMode(2, INPUT_PULLUP);
  pinMode(3, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
  pinMode(6, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
  pinMode(8, INPUT_PULLUP);
  pinMode(9, INPUT_PULLUP);
  pinMode(10,INPUT_PULLUP);
  pinMode(13, OUTPUT);
}

int * SetPass() {
  i = 0;
  for (i = 1; i<=9; ++i) {
     if(buttons[i] == LOW) {
      passTrue[i] = buttons[i];
     }
  }
return passTrue;
}
  
  void CheckPass() {
    for(i=1; i<=9; ++i) {
      if(passTrue[i] != buttons[i]) {
        Serial.println("false Password");
      }
    }
  }

void Test() {
  for(i=1; i<=9; ++i) {
   buttons[i] = 0;
   passTrue[i] = 1;
  }
}

  void loop() {
SetButtons();
SetPass();
Test();
CheckPass();
  
  }

int buttons[] {}; Oops

Also array elements are numbered from 0 not 1 so your for loops need sorting out.

Steve

Also, array indicies start at 0, and go up to n-1...

int passTrue[9];

This array has elements passTrue[0] through passTrue[8].

There is no element [9], but your code is trying to access it...

for (i = 1; i<=9; ++i) {

And also not using element 0. Not using element 0 is wasteful, but not a problem. Writing to element [9] is a big problem.

Almost as much of a problem as writing to ANY element of this array...

int buttons[] {};

(Further hint: It has 0 elements).