0

I don't know what part of my code is wrong. I tried changing the value of triple.rgbtBlue, triple.rgbtGreen and triple.rgbtRed but the result is the same, with an yellow background. Please help.

ver.png

for (int j = 0; j < bi.biWidth; j++)
{
    // temporary storage
    RGBTRIPLE triple;

    // read RGB triple from infile
    fread(&triple, sizeof(RGBTRIPLE), 1, inptr);
    if( (triple.rgbtBlue=0x00) && (triple.rgbtGreen=0x00)&& (triple.rgbtRed=0xff) )
    {
        triple.rgbtBlue=0xff;
        triple.rgbtGreen=0xff;
        triple.rgbtRed=0xff;
    }

    // write RGB triple to outfile

    fwrite(&triple, sizeof(RGBTRIPLE), 1, outptr);
}
2
if( (triple.rgbtBlue=0x00) && (triple.rgbtGreen=0x00)&& (triple.rgbtRed=0xff) )

What is the difference between an assignment operator, = and an equality test operator, ==? What happens when you use = in a logic test?

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .