标签:clu color std turn style div return while span
结构体链表
1 #include <stdio.h> 2 struct tnode 3 { 4 char *word; 5 int count; 6 struct tnode *left; 7 struct tnode *right; 8 }; 9 10 int main(int argc, char const *argv[]) 11 { 12 13 struct tnode a, b, c, *tmp; 14 a.word = "a"; 15 b.word = "b"; 16 c.word = "c"; 17 a.left = &b; 18 b.left = &c; 19 c.left = NULL; 20 tmp = &a; 21 char *p = NULL; 22 do { 23 printf("%s\n", tmp->word); 24 25 } while(tmp = tmp->left); 26 27 return 0; 28 }
执行结果
a
b
c
标签:clu color std turn style div return while span
原文地址:http://www.cnblogs.com/snail88/p/7533428.html