在下面的代码片段中,可以做些什么来 a) 使编译器安静,以及 b) 清理令人眼花缭乱的指针混乱?
extern struct tree *sintablein[sintablesize];
struct tree *(*tablein)[];
int i;
tablein = &sintablein; // The compiler complains:
// "redundant & applied to array (warning)" and
// "illegal conversion between pointer types (warning)"
for(i = 0; i < 10; i++) {
struct tree *tablemember = (*tablein)[i]; // However, this works like a charm.
// Do stuff with tablemember
}
我能够做到这一点的唯一方法是使用非常有用的http://cdecl.org/。特别是关于 (b),如何尽可能简化指针和取消引用?