我这里有代码流。请trchDl1p7kbps.trchDetail[0]->trchNo = 0;
在以下代码中给我替代解决方案
struct trchParam_
{
unsigned int trchNo;
};
typedef struct trchParam_ trchParam;
struct trchDetail_
{
trchParam **trchDetail;
};
typedef struct trchDetail_ trchDetail;
int main(void)
{
trchDetail trchDl1p7kbps;
trchDl1p7kbps.trchDetail = (trchParam **)malloc(sizeof(trchParam **) * 1);
*trchDl1p7kbps.trchDetail = (trchParam *)malloc(sizeof(trchParam *));
trchDl1p7kbps.trchDetail[0]->trchNo = 0;
}
如何避免数组表示法?我可以在这里使用pointer
( *
) 代替[]
吗?