I wish i could be more specific but i really don't understand the errors i'm getting
This is my reflect function:
// Reflect image horizontally
void reflect(int height, int width, RGBTRIPLE image[height][width])
{
int tempRed = 0;
int tempGreen = 0;
int tempBlue = 0;
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
{
int index = width - j;
tempRed = image[i][j].rgbtRed;
tempGreen = image[i][j].rgbtGreen;
tempBlue = image[i][j].rgbtBlue;
image[i][j].rgbtRed = image[i][index].rgbtRed;
image[i][j].rgbtGreen = image[i][index].rgbtGreen;
image[i][j].rgbtBlue = image[i][index].rgbtBlue;
image[i][index].rgbtRed = tempRed;
image[i][index].rgbtGreen = tempGreen;
image[i][index].rgbtBlue = tempBlue;
}
}
return;
}
And these are the errors i'm getting:
helpers.c:89:35: runtime error: index 600 out of bounds for type 'RGBTRIPLE [width]'
helpers.c:90:37: runtime error: index 600 out of bounds for type 'RGBTRIPLE [width]'
helpers.c:91:36: runtime error: index 600 out of bounds for type 'RGBTRIPLE [width]'
helpers.c:93:13: runtime error: index 600 out of bounds for type 'RGBTRIPLE [width]'
helpers.c:94:13: runtime error: index 600 out of bounds for type 'RGBTRIPLE [width]'
helpers.c:95:13: runtime error: index 600 out of bounds for type 'RGBTRIPLE [width]'