I have defined a new struct type called RGBTRIPLE but I'm not able to assign values to it.I'm trying to create a test file to test the different parts of blur code in cs50.
#include <stdio.h>
#include <stdint.h>
typedef uint8_t BYTE;
typedef struct
{
BYTE rgbtBlue;
BYTE rgbtGreen;
BYTE rgbtRed;
}
RGBTRIPLE;
int main(void)
{
int height = 3;
int width = 3;
RGBTRIPLE image[3][3];
image[2][2].rgbtRed = {{10, 40, 70},{110, 120, 130},{200, 220, 240}};
image[2][2].rgbtGreen = {{20, 50, 80},{130, 140, 150},{210, 230, 250}};
image[2][2].rgbtBlue = {{30, 60, 90},{140, 150, 160},{220, 240, 255}};
}
I am getting a error
2.c:22:24: error: expected expression
image[2][2].rgbtRed = {{10, 40, 70},{110, 120, 130},{200, 220, 240}};
^
2.c:23:26: error: expected expression
image[2][2].rgbtGreen = {{20, 50, 80},{130, 140, 150},{210, 230, 250}};
^
2.c:24:25: error: expected expression
image[2][2].rgbtBlue = {{30, 60, 90},{140, 150, 160},{220, 240, 255}};