Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15357888
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类: LINUX

2008-10-24 14:48:43

#include <stdio.h>
#include <string.h>

#define LMAP_ENTRIES 100
struct lmap {
    const char *name;
    void *data;
};
struct luther_gliethttp {
    struct lmap lmap[LMAP_ENTRIES];
    const char *name;
};

static struct luther_gliethttp luther = {
    .lmap = {
        [0 ... LMAP_ENTRIES-1] = { "gliethttp", NULL }
    },
    .name = "luther",
};
int main(int argc, char *argv[])
{
    int i;
    for (i = 0; i < LMAP_ENTRIES; i++) {
        printf("luther.lmap[%d].name = %s\n", i, luther.lmap[i].name);
    }
    printf("%p\n", ((unsigned int)(0x01 << ((sizeof(int) * 8) - 1)) - 1));
}

阅读(2727) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~