|
SESSION_POS_S *pTestpos1, *pTestpos2, *pTestpos3, *pPos;
LIST *pMyList = NULL;
int NodeIndex = 0;
DPRINT("-------- lstAdd测试 -------\n");
pMyList == (LIST*)pro_malloc(sizeof(LIST));
lstInit((LIST*)pMyList);
//添加三个节点:
pTestpos1 = (SESSION_POS_S*)pro_malloc(sizeof(SESSION_POS_S));
pTestpos1->ulSessionId = 1;
pTestpos1->ucTsuId = 2;
pTestpos1->ucPortId = 3;
DPRINT("sessionId=%d,TsuId = %d, PortId =%d\n", pTestpos1->ulSessionId,
pTestpos1->ucTsuId, pTestpos1->ucPortId);
lstAdd((LIST*)pMyList, (NODE*)pTestpos1); //添加第一个节点 ******************************* 这里添加后为什么会修改pTestpos1中的值?
DPRINT("sessionId=%d,TsuId = %d, PortId =%d\n", pTestpos1->ulSessionId,
pTestpos1->ucTsuId, pTestpos1->ucPortId);
================
//输出
sessionId=1,TsuId = 2, PortId =3
sessionId=1,TsuId = 0, PortId =0
请我哪里使用错了?谢谢
|
|