invalid conversion from 'int (*)(uint8_t) {aka int (*)(unsigned char)}' to 'int'

hi, when runnning my code I get the error message:
" invalid conversion from 'int ()(uint8_t) {aka int ()(unsigned char)}' to 'int' [-fpermissive] "

here is the relevant part of my code;

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

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

various errors. the following compiles

int i;
int passTrue[9];
#if 0
int buttons[] {};
#else
int buttons[9] = {};
#endif

#if 1
int * setButtons() {
#else
int  setButtons() {
#endif

#if 0
  for (int i = 1; i<=9; ++i) {
#else
  for (int i = 1; i< 9; ++i) {
#endif

#if 0
      buttons[i] = digitalRead[i];
#else
      buttons[i] = digitalRead(i);
#endif

#if 0
    return buttons;
 }
#else
 }
 return buttons;
#endif
}     

void setup (void) {}
void loop (void) {}

the only error was using brackets instead of parenthesis, after correcting that the code compiled without any errors.

What's the point of

yamfe1:
the only error was using brackets instead of parenthesis

Also, writing to an array that contains no elements.

Also, returning a pointer to an array that's already global -- technically not an error, but bad form.

the code compiled without any errors

Probably won't work, though. Post the revised code and we can help you fix it.

yamfe1:
the only error was using brackets instead of parenthesis, after correcting that the code compiled without any errors.

C:\stuff\SW\Arduino\_Others\Download\Tst\Tst.ino: In function 'int* setButtons()':

C:\stuff\SW\Arduino\_Others\Download\Tst\Tst.ino:8:33: warning: pointer to a function used in arithmetic [-Wpointer-arith]

       buttons[i] = digitalRead[i];

                                 ^

C:\stuff\SW\Arduino\_Others\Download\Tst\Tst.ino:8:33: warning: invalid conversion from 'int (*)(uint8_t) {aka int (*)(unsigned char)}' to 'int' [-fpermissive]

C:\stuff\SW\Arduino\_Others\Download\Tst\Tst.ino:11:1: warning: control reaches end of non-void function [-Wreturn-type]

 }

yamfe1:
here is the relevant part of my code;

// int i;  /////////////// Not used. A local variable of the same name is used
// int passTrue[9];    ///////// Declared but not used
int buttons[10];       ///////// You write into the 10th element so make the array long enough

void setButtons()   /////////// No need to return a global variable since it is global
{
  for (int i = 1; i<=9; ++i) 
  {
    buttons[i] = digitalRead(i);  ////////// Use '()' to call the digitalRead() function
    // return buttons;  /////////// YIKES! This will exit the function after reading Pin 1.  The others will never get read.
 }
}