idx x, z ;
for (x = 0 ; x < k ; ++x) {
if (mots[x].mot) {
printf("%s :", mots[x].mot) ;
//Below not working properly how to write all my refs ?
// printf("%i ", mots[x].refs -> cdr ->ref);
// while (mots[x].refs -> cdr) printf("%i ", mots[x].refs -> ref);
printf("\n") ;
如何正确迭代我的结构以显示 mots[x] 的每个引用?
我希望问题足够清楚,提前致谢
最佳答案
if (mots[x].mot) {
printf("%s :", mots[x].mot) ;
struct node *node = mots[x].refs;
while (node) {
printf("%i ", node->ref);
node = node->cdr;
}
printf("\n");
}
关于c - 在c中显示递归结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32161159/