0

I am getting the following error in the reflect part of my filter and I am not sure what it means and how should i avoid it

helpers.c:71:23: error: subscript of pointer to function type 'void (int, int, RGBTRIPLE (*)[width])'
        image[i][k] = reflect[k]; 

Code of my reflect function is as follows:

    void reflect(int height, int width, RGBTRIPLE image[height][width])
{   
    for(int i = 0;i<height;i++)
    {
        //for(int j =0,k = (int)(width/2);j<k;j++)
        for(int j =0;j<width;j++)
        {
            RGBTRIPLE *reflect = malloc(width*sizeof(RGBTRIPLE));
            reflect[j] = image[i][width-1-j];
        }

        for (int k =0;k<width;k++)
    {
        image[i][k] = reflect[k];
    }

    free(reflect);
    }  



    return;
}```
1
  • The pointer is type BYTE rather than type RBGTRIPLE. It is pointing to a single element of the RGBTRIPLE. – Claire Jun 1 '20 at 10:17

You must log in to answer this question.

Browse other questions tagged .