xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 1.17MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-11-15
  • 語言: C/C++
  • 標(biāo)簽:

資源簡介

花了5小時(shí)++編的使用C++程序?qū)崿F(xiàn)HDLC協(xié)議的相關(guān)內(nèi)容,之前有位朋友也編了個(gè)程序,不過其效果不敢茍同啊,這樣才是我覺得應(yīng)該自己編一個(gè)放在網(wǎng)上,供大家分享指正。謝謝啊!

資源截圖

代碼片段和文件信息

#include
#include
#include?


typedef?struct?cNode{??????????//定義一個(gè)結(jié)構(gòu)體
char?byData;???????????????//節(jié)點(diǎn)存儲(chǔ)的數(shù)據(jù)
struct?cNode*?pNext;//指針:指向下一個(gè)節(jié)點(diǎn)
struct?cNode*?pLast;//指針:指向前一個(gè)節(jié)點(diǎn)
}cNode;


cNode*?fnCreat(cNode*?pListHead) ???//建立一個(gè)鏈表
{
cNode?*pNewNode??*pListNode;?//聲明鏈表的指針,分別是新建的節(jié)點(diǎn)指針、當(dāng)前節(jié)點(diǎn)指針、鏈表表頭指針;
char?byInputNodeData;//聲明一個(gè)字符變量,用于暫時(shí)存儲(chǔ)節(jié)點(diǎn)數(shù)據(jù)的輸入;
fflush(stdin);//情空鍵盤緩沖區(qū)數(shù)據(jù);
scanf(“%c“??&byInputNodeData);
while(byInputNodeData??!=??‘\n‘)//如果輸入字符不是“回車/換行符”則創(chuàng)建一個(gè)新節(jié)點(diǎn)并存儲(chǔ)該輸入,然后將節(jié)點(diǎn)加入到鏈表的尾部
{
if(byInputNodeData??==??‘0‘|byInputNodeData??==??‘1‘)
{
????pNewNode??=??(cNode*)malloc(sizeof(cNode));//創(chuàng)建新節(jié)點(diǎn)
????pNewNode->byData??=??byInputNodeData;
????pNewNode->pNext??=??NULL;
????pNewNode->pLast??=??NULL;
????if(pListHead??==??NULL)//如果鏈表為空鏈表則建立第一個(gè)節(jié)點(diǎn);
????{
????pListHead??=??pNewNode;
????pListNode??=??pListHead;
????}
????else//如果不是空鏈表則在后續(xù)加入新節(jié)點(diǎn);
????{
????pListNode->pNext??=??pNewNode;
????pNewNode->pLast??=??pListNode;
????????pListNode??=??pNewNode;
????};
????};
scanf(“%c“??&byInputNodeData);//繼續(xù)讀入下一個(gè)字節(jié)數(shù)據(jù),每次僅讀取一個(gè)自己,剩余字節(jié)將會(huì)暫存在鍵盤的輸入緩沖區(qū)。
}
return(pListHead);//返回鏈表表頭指針;
}

cNode*?fnReceive(cNode*?pListHead)???????????//接收的0/1比特序列,即由鏈表pListHead模擬的串行數(shù)據(jù);
?????????????????????????????????????????//HDLC的串行輸入數(shù)據(jù)處理,即每5位連1后面如果有一個(gè)0則把它去掉;
{
cNode?*pChange?*pListNode??=??pListHead;
int?nCount??=??0;
while(pListNode??!=??NULL)
{
if(pListNode->byData??==??‘1‘?&&?nCount?? {
nCount??++;
pListNode??=??pListNode->pNext?;
}
else?
{
if(pListNode->byData??==??‘0‘&&?nCount?? {
nCount??=??0;
pListNode??=??pListNode->pNext;
}
if(pListNode->byData??==??‘0‘?&&nCount??==??5)????????????????
{
nCount??=??0;
pChange??=??pListNode->pLast;
pChange->pNext??=??pListNode->pNext;
pChange??=??pListNode->pNext;
pChange->pLast??=??pListNode->pLast;
pChange??=??pListNode;
pListNode??=??pChange->pNext?;
free(pChange);
}
else?
return?(pListHead);
}
}
return(pListHead);
}

cNode*?fnSend(cNode*?pListHead)????????//發(fā)送的0/1比特序列,即由鏈表pListHead模擬的串行數(shù)據(jù);HDLC的串行輸出數(shù)據(jù)處理,即每5位連1后面加一個(gè)0;
{
cNode??*pChange*pNewNode?*pListNode??=??pListHead;
int?nCount??=??0;
while(pListNode->pNext?!=??NULL)
{
if(pListNode->byData??==??‘1‘?&&?nCount?? {
nCount??++;
pListNode??=??pListNode->pNext?;
}
else?
{
if(pListNode->byData??==??‘0‘)
{
nCount??=??0;
pListNode??=??pListNode->pNext?;
}
else?if(pListNode->byData??==??‘1‘?&&nCount??==??5)?????????????????
{
nCount??=??0;
pNewNode??=??(cNode*)malloc(sizeof(cNode));?????????
pNewNode->byData??=??‘0‘;
pNewNode->pNext??=??pListNode;?
pNewNode->pLast??=??pListNode->pLast;
pChange??=??pNewNode->pLast;
pChange->pNext??=??pNewNode;
pListNode->pLast??=??pNewNode;
}
}
}
return(pListHead);
}

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件????????652??2011-10-06?21:18??HDLC程序\Debug\cl.command.1.tlog

?????文件???????1850??2011-10-06?21:18??HDLC程序\Debug\CL.read.1.tlog

?????文件????????290??2011-10-06?21:18??HDLC程序\Debug\CL.write.1.tlog

?????文件???????1657??2011-10-06?19:24??HDLC程序\Debug\hdlc.Build.CppClean.log

?????文件?????455680??2011-10-06?21:18??HDLC程序\Debug\hdlc.exe

?????文件????????406??2011-10-06?19:25??HDLC程序\Debug\hdlc.exe.embed.manifest

?????文件????????472??2011-10-06?19:25??HDLC程序\Debug\hdlc.exe.embed.manifest.res

?????文件????????381??2011-10-06?21:18??HDLC程序\Debug\hdlc.exe.intermediate.manifest

?????文件????1019416??2011-10-06?21:18??HDLC程序\Debug\hdlc.ilk

?????文件?????????65??2011-10-06?21:18??HDLC程序\Debug\hdlc.lastbuildstate

?????文件???????2865??2011-10-06?21:18??HDLC程序\Debug\hdlc.log

?????文件???????8895??2011-10-06?21:18??HDLC程序\Debug\hdlc.obj

?????文件????1969152??2011-10-06?21:18??HDLC程序\Debug\hdlc.pdb

?????文件????????204??2011-10-06?19:25??HDLC程序\Debug\hdlc_manifest.rc

?????文件??????????2??2011-10-06?21:18??HDLC程序\Debug\link-cvtres.read.1.tlog

?????文件??????????2??2011-10-06?21:18??HDLC程序\Debug\link-cvtres.write.1.tlog

?????文件??????????2??2011-10-06?21:18??HDLC程序\Debug\link.3932-cvtres.read.1.tlog

?????文件??????????2??2011-10-06?21:18??HDLC程序\Debug\link.3932-cvtres.write.1.tlog

?????文件??????????2??2011-10-06?21:18??HDLC程序\Debug\link.3932.read.1.tlog

?????文件??????????2??2011-10-06?21:18??HDLC程序\Debug\link.3932.write.1.tlog

?????文件??????????2??2011-10-06?21:18??HDLC程序\Debug\link.6720-cvtres.read.1.tlog

?????文件??????????2??2011-10-06?21:18??HDLC程序\Debug\link.6720-cvtres.write.1.tlog

?????文件??????????2??2011-10-06?21:18??HDLC程序\Debug\link.6720.read.1.tlog

?????文件??????????2??2011-10-06?21:18??HDLC程序\Debug\link.6720.write.1.tlog

?????文件???????1348??2011-10-06?21:18??HDLC程序\Debug\link.command.1.tlog

?????文件???????2932??2011-10-06?21:18??HDLC程序\Debug\link.read.1.tlog

?????文件????????684??2011-10-06?21:18??HDLC程序\Debug\link.write.1.tlog

?????文件????????360??2011-10-06?21:18??HDLC程序\Debug\mt.command.1.tlog

?????文件????????278??2011-10-06?21:18??HDLC程序\Debug\mt.read.1.tlog

?????文件????????278??2011-10-06?21:18??HDLC程序\Debug\mt.write.1.tlog

............此處省略24個(gè)文件信息

評(píng)論

共有 條評(píng)論

相關(guān)資源