vern@2009-08-19:/dev% ls tags
c

结构数组的初始化方法

#include <iostream.h>

typedef struct memory_area_struct {
    unsigned int start;
    unsigned int size;
    int used;
} memory_area_t;

#define NUM_MEM_AREAS 10
memory_area_t memory_map[NUM_MEM_AREAS] = {
    [0 ... (NUM_MEM_AREAS - 1)] = {
        .start = 0,
        .size = 0,
        .used = 0
    },
};