Need help with array filling function

Let me start by saying I have only been at this for about two months, and had no idea what C++ was before that. I am confused about why the code below worked. It is a simple array filling function that fills an array with user inputed data:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//excerpt from main function   

    cout << " Enter " << ARRAY_SIZE << "integers: "; //ARRAY_SIZE = 10

    fillArray(listA, ARRAY_SIZE);

    cout << "After filling listA, "
         << "the elements are: " << endl;

    printArray(listA, ARRAY_SIZE);

void fillArray(int x[], int sizeX)
{
    int index;

    for (index = 0; index < sizeX ; index++)
        cin >> x[index];
}

void printArray(const int x[], int sizeX)
{
    int index;

    for (index = 0; index < sizeX; index++)
        cout << x[index];
}



My question: How does the user input make it into the fillArray function? I dont see any variable to pass it into the input into the fillArray function.
line 17
Great, I'm an idiot. Thank you.
Topic archived. No new replies allowed.