How to assemble multiple variables in one variable?

I want to give same function to multiple variables, for example:

public GameObject a;
public GameObject b;
public GameObject c;

void Update()
{
    a.transform.position = transform.position + new Vector3(0, 0, 10 * Time.deltaTime);
    b.transform.position = transform.position + new Vector3(0, 0, 10 * Time.deltaTime);
    c.transform.position = transform.position + new Vector3(0, 0, 10 * Time.deltaTime);
}

Instead of that, how could I combine all variables like:

public GameObject[] go;

void Update()
{
    go.transform.position = transform.position + new Vector3(0, 0, 10 * Time.deltaTime);
}

If I do like that, the console shows “error CS1061: ‘GameObject’ does not contain a definition for ‘transform’ and no accessible extension method ‘transform’ accepting a first argument of type ‘GameObject’ could be found (are you missing a using directive or an assembly reference?)”

I guess that I don’t know how to use array.

You want to iterate the array of objects to apply it to every object:

public GameObject[] gameObjects

void Update()
{
    foreach(GameObject go in gameObjects)
    {
        go.transform.position = transform.position + new Vector3(0, 0, 10 * Time.deltaTime);
    }
}

However I would suggest avoiding creating a new Vector3 in every update if the vector is going to be
composed of static components. Instead you can cache the vector and multiply by Time.deltaTime:

public GameObject[] gameObjects

private Vector3 moveDelta = new Vector3(0, 0, 10);

void Update()
{
    foreach(GameObject go in gameObjects)
    {
        go.transform.position = transform.position + (moveDelta * Time.deltaTime);
    }
}

Also, if you want to practice with Arrays, you can check out the Microsoft docs, and Tutorialspoint also has some good coverage of arrays in C#