我有以下结构:
typedef struct bucket {
unsigned int contador;
unsigned int * valor;
} Bucket;
typedef struct indice {
unsigned int bs;
unsigned int valor;
unsigned int capacidade;
Bucket * bucket;
} Indice;
typedef struct tabela {
unsigned int bs;
Indice * indice;
} Tabela;
我想做这样的事情:
tabela->indice[2].bucket = &tabela->indice[0].bucket;
但我得到分段错误。
如何获取tabela->indice[0].bucket
地址并关联到tabela->indice[2].bucket
.
谢谢!