Initialize servo array on setup

Hello, I’m new in this comunity! I feel a little bit embarassed to post a so simple question but after a few hours of triyng, I haven’t yet found an answer.
I’m working on a project that uses a number of servos. I’m trying to initialize them by using this code:

#include <Servo.h>

const int numOfServos = 1;
const int servosPins = {9};
const int servosPosition = {0};
Servo servosArray[numOfServos];

(in this case i’m using just one servo, but the idea is to extend that number as far as it works)

Up to that I have no problem, but the error occurs in the Setup function:

void setup() {

for(int k = 0; k < numOfServos; k++) {
servosArray[k].attach(servosPins[k]);
servosArray[k].write(servosPosition[k]);
}

}

Especially with the argument of the attach and write methods.

I get the error: “invalid types ‘const int[int]’ for array subscript”

When you encounter an error you’ll see a button on the right side of the orange bar “Copy error messages”. Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

Sorry, here it is the full error message:

Arduino:1.8.5 (Windows 10), Tarjeta:"Arduino/Genuino Uno"

v1:50: error: invalid types 'const int[int]' for array subscript

     servosArray[k].attach(servosPins[k]);

                                       ^

v1:51: error: invalid types 'const int[int]' for array subscript

     servosArray[k].write(servosPosition[k]);

                                          ^

exit status 1
invalid types 'const int[int]' for array subscript

You forgot to make servosPins and servosPosition arrays. Change this:

const int servosPins = {9};
const int servosPosition = {0};

to this:

const int servosPins[] = {9};
const int servosPosition[] = {0};