VC 鍊錶操作

2021-06-17 15:01:58 字數 1010 閱讀 2389

#include

#include

#include

#include

//編譯時需要使用多執行緒的版本的執行庫

cstringlist strlist;

void print()

for(int i=0;i<10;i++)

else

}//列印鍊錶

print();

//獲得煉表頭節點的位置

position pos=strlist.getheadposition();

//設定指定節點位置的內容

strlist.setat(pos,"a");

print();

//刪除頭尾節點

strlist.removehead();

strlist.removetail();

print();

//在指定位置之前插入節點

pos=strlist.gettailposition();

strlist.insertbefore(pos,"b");

//在指定節點位置之後插入節點

pos=strlist.getheadposition();

strlist.insertafter(pos,"a");

print();

//查詢指定的節點,如果沒有找到則返回空

pos=strlist.find("0");

//刪除指定節點

if(pos)

print();

cstringlist strlist2;

strlist2.addhead("#");

//在頭部與其他鍊錶合併

strlist.addhead(&strlist2);

//在尾部與其他鍊錶合併

strlist.addtail(&strlist2);

print();

//清空所有節點

strlist.removeall();

return 0;

}

VC操作登錄檔

1.vc讀取登錄檔資訊 hkey hkey lpctstr data set software yeete s long ret5 regopenkeyex hkey local machine,data set,0,key write key read,hkey long ret0 regdele...

VC操作登錄檔

vc操作登錄檔 邵盛松 2010 3 2 新增標頭檔案atlbase.h 寫入登錄檔鍵值 以設定字串值為例 cstring strpath t c name.exe cregkey key if key.create hkey local machine,t software microsoft w...

VC 登錄檔操作

獲取登錄檔值 hkey hkey lpctstr data set software internet long ret0 regopenkeyex hkey local machine,data set,0,key all access,hkey lpbyte lpa new byte 500 d...