指针数组的创建及初始化问题
我想在多个地方创建名称相同的指针数组,应如何创建。
我的代码如下:
while(1)
{
     struct a *a;  
     struct a *b[25];
     struct a *c;
     int i=0;
     a=kmalloc(sizeof(struct a),GFP_KERNEL);
     for(i=0;i<25;i++)
    {  
       b[i]=kmalloc(sizeof(struct a),GFP_KERNEL);
    }
    a->n=b;
    c=kmalloc(sizeof(struct a),GFP_KERNEL);
    a=c;
}
但我发现每个结构体a的n成员内容全一样。按理说应该是不同的,这是为什么,怎么样才能让每个a的成员n指向不同的指针数组b?
------解决方案--------------------
最好先学一下编程风格