People,
I have a little problem and I don't seem to get. I've seen examples that worked this way but mine won't.
Code:
typedef struct
{
BYTE rgbtBlue;
BYTE rgbtGreen;
BYTE rgbtRed;
} __attribute__((__packed__))
RGBTRIPLE;
// iterate over infile's scanlines
for (int i = 0, biHeight = abs(bi.biHeight); i < biHeight; i++)
{
// iterate over pixels in scanline
for (int j = 0; j < bi.biWidth; j++)
{
// temporary storage
RGBTRIPLE triple;
// read RGB triple from infile
fread(&triple, sizeof(RGBTRIPLE), 1, inptr);
printf("%x\n",triple.rgbtRed);
// write RGB triple to outfile
fwrite(&triple, sizeof(RGBTRIPLE), 1, outptr);
}
With this it seem to compile fine and seems to get only the red value.
But if I want to change printf("%x\n",triple.rgbtRed); to something like this :
Code:
if (triple.rgbtRed != 0x00)
triple.rgbtred = 0x00;
I'll get a compile error :
error: ‘RGBTRIPLE’ has no member named ‘rgbtred’
If searched on google for the error message but the results I got were way to complicated.