1长数组使用

void *
GdItemAlloc(unsigned int size)
{
    return (void *)calloc(size, 1);
}

typedef struct {
    MWGDIOBJHDR    hdr;
    int        width;        /* width*/
    int        height;        /* height*/
    int        planes;        /* # planes*/
    int        bpp;        /* bits per pixel*/
    int        linelen;    /* bytes per line*/
    int        size;        /* allocated size in bytes*/
    char         bits[1];    /* beginning of bitmap*/
} MWBITMAPOBJ;

/* allocate gdi object*/
hbitmap = (MWBITMAPOBJ *)GdItemAlloc(sizeof(MWBITMAPOBJ)-1+size);

hbitmap->size = size;

原文地址:https://www.cnblogs.com/cute/p/2507294.html