表达式必须具有指向对象的引用(C ++)

时间:2012-01-06 01:18:57

标签: c++

我正在研究一个bootloader,我得到这个语法错误,并且不知道它意味着什么,如果有人可以帮助我,那将非常感激。

bool DrawBitmap(BYTE Bitmap, int x, int y, int w, int h)
{
    for(int i=0;i<=w;i++)
        for(int i2=0;i2<=h; i2++)
        {
            setpixel(i+x,i2+h, Bitmap[(((w*i2)-1)+i)]);
        }
}

注意,错误发生在[(((w*i2)-1)+i)]

1 个答案:

答案 0 :(得分:0)

位图作为BYTE传递。可能它应该是BYTE指针。

尝试像这样定义你的函数:

bool DrawBitmap(BYTE *Bitmap, int x, int y, int w, int h)
{  
    for(int i=0;i<=w;i++)  
        for(int i2=0;i2<=h; i2++)  
        {  
            setpixel(i+x,i2+h, Bitmap[(((w*i2)-1)+i)]);
        }  
}