关于结构链表的取值有关问题
关于结构链表的取值问题
我自己定义一结构
{
int ID;
CString value;
BOOL outtimer;
.....
CString wd;
}
然后定义一个链表m_RecordList,每个结点是一个结构;
在结构链表中存放了许多纪录,现要一次将该链表中的各个结点的wd值,取出,请问如何实现?
------解决方案--------------------
用stl
#include <vector>
using namespace std;
typedef struct _mystruct
{
int ID;
CString value;
BOOL outtimer;
.....
CString wd;
}mystruct;
typedef vector <mystruct> MYSTRUCT_LIST;
MYSTRUCT_LIST m_RecordList;
MYSTRUCT_LIST::iterator it;
for (it = m_RecordList.begin(); it != m_RecordList.end(); it++)
{
it-> wd.....
}
------解决方案--------------------
POSITION pos;
........
pos = m_RecordList.FindIndex(i);
m_RecordList.GetAt(pos)-> wd;
------解决方案--------------------
CrazyAzreal(顶..真系稳食艰难!) 正解
我自己定义一结构
{
int ID;
CString value;
BOOL outtimer;
.....
CString wd;
}
然后定义一个链表m_RecordList,每个结点是一个结构;
在结构链表中存放了许多纪录,现要一次将该链表中的各个结点的wd值,取出,请问如何实现?
------解决方案--------------------
用stl
#include <vector>
using namespace std;
typedef struct _mystruct
{
int ID;
CString value;
BOOL outtimer;
.....
CString wd;
}mystruct;
typedef vector <mystruct> MYSTRUCT_LIST;
MYSTRUCT_LIST m_RecordList;
MYSTRUCT_LIST::iterator it;
for (it = m_RecordList.begin(); it != m_RecordList.end(); it++)
{
it-> wd.....
}
------解决方案--------------------
POSITION pos;
........
pos = m_RecordList.FindIndex(i);
m_RecordList.GetAt(pos)-> wd;
------解决方案--------------------
CrazyAzreal(顶..真系稳食艰难!) 正解