我有一个结构,在里面我有指针(每个都指向一个char数组)。如何创建指向结构内部指针之一的指针?
答案 0 :(得分:0)
假设C:
struct foo { // a struct
char (*a)[10], (*b)[10]; // pointers to arrays[10] of char
};
struct foo x; // create an object
char (**p)[10]; // pointer to pointer to array[10] of char
p = &x.a; // point to one of the pointers inside the struct