#define MAXLINELENGTH 8192
struct Image {
unsigned int height;
unsigned int width;
unsigned int value;
unsigned int maxValue;
unsigned int data[MAXLINELENGTH];
};
Image *Image_Init ()
{
Image *tmpImage;
unsigned int data[MAXLINELENGTH];
//if(tmpImage != NULL)
//{
tmpImage->height = 0;
tmpImage->width = 0;
tmpImage->value = 0;
tmpImage->maxValue = 0;
for (int i = 0; i < MAXLINELENGTH; i++)
{
tmpImage -> data[i] = data[i];
}
//tmpImage.data = {};
//return &tmpImage;
//}
return tmpImage;
}
unsigned int Image_Get_Height (Image *img)
{
Image *tmpImage;
int UINT_MAX;
UINT_MAX = tmpImage.height;
//int UINT_MAX;
//UINT_MAX = img.height;
return UINT_MAX;
}
发生错误,我不知道如何修复它。
c:73: 错误:在 'tmpImage' 中请求成员 'height',它是非类类型 'Image*'
请帮助解决此错误。