鏈表參數(shù)的引用與非引用
摘要:
今天做了一個簡單的題目。但是,我發(fā)現(xiàn),在傳參數(shù)的時候,如果不使用引用傳參,那么頭指針就會隨著tmp指針向后移動。如果使用引用傳參的話,它就不會了。題目:http://acm.swust.edu.cn/oj/problem/172/View Code #include<stdio.h>#include<stdlib.h>#include<string.h>typedef struct node{ int n; struct node *next;}node;node *A, *B, *ta, *tb, *p;void Init_AB(){ A = (node* 閱讀全文
posted @ 2012-05-08 22:50 More study needed. 閱讀(509) 評論(0) 推薦(0)
浙公網(wǎng)安備 33010602011771號