I am getting error when I pass an array to a function

**Array:** `int red_eachpix[MAX_PIX] = { 0 }`

**Function:**

```
void sum_individualpix(int *pixels, int pixle) {
    pixels[(pixle - 1)]++;
}

```

**Error:** error C2664: 'void sum\_individualpix(int,int)' : cannot convert argument 1 from 'int [255]' to 'int'

**The whole program is given below:**

```
#define MAX_PIX 255
#define WIDTH 25
#define HEIGHT 25

void sum_individualpix(int , int);    // I think the error is here

int main()
{
    int X, Y, red, counter = 0;
    int red_eachpix[MAX_PIX] = { 0 }, Red[WIDTH][HEIGHT] = { 0 };
    long sum_red = 0;
    in.open("basicval.txt");
    if (in)
    {
        in >> X >> Y >> red;  //Data is in form of:   X  Y    B1(red pixel value)
        while (!in.eof())
            {
                counter++;
                sum_red += red;

                Red[X][Y] = red;

                sum_individualpix(red_eachpix, red);    //Getting Error here

                in >> X >> Y >> red;
             }

         double avg_red = (double)sum_red / counter;
         cout << "Average Value for Red = " << avg_red << endl;
    }
    in.close();
    getchar();
}

void sum_individualpix(int *pixels, int pixle) {
    pixels[(pixle - 1)]++;
}

```

---

Just in case anyone wants to know the program reads the pixel values of an image, while the image itself has been converted into ASCII values by a program

***Edited:*** Actually the `Red[WIDTH][HEIGHT]` & `int X, Y, red, counter = 0;` was not a mistake. I wrote it wrong accidentally.