FMC CList 实例,元素是结构体struct
来源:互联网 发布:留言板 数据库 编辑:程序博客网 时间:2024/06/03 04:03
声明变量:
struct MyRangeStruct{int n_indext;long long n_start;long long n_end;int len;};CList<MyRangeStruct, MyRangeStruct&> AllRangeList;
初始化CList:
void CMFCcodeDlg::InitMacRangeList(void){int n_max = dest.GetSize();int n_len_temp = 0, n_index_temp = 0;for (int i = 0; i < n_max; i++){MyRangeStruct my_RangeStruct;my_RangeStruct.n_indext = n_index_temp + n_len_temp;n_index_temp = my_RangeStruct.n_indext;ParseCString(dest[i], my_dest, '-');if (my_dest.GetSize() > 1){my_RangeStruct.n_start = Hex2Dec(my_dest[0]);my_RangeStruct.n_end = Hex2Dec(my_dest[1]);my_RangeStruct.len = my_RangeStruct.n_end - my_RangeStruct.n_start + 1;n_len_temp = my_RangeStruct.len;} else if (my_dest.GetSize() == 1){my_RangeStruct.n_start = Hex2Dec(my_dest[0]);my_RangeStruct.n_end = Hex2Dec(my_dest[0]);my_RangeStruct.len = my_RangeStruct.n_end - my_RangeStruct.n_start + 1;n_len_temp = my_RangeStruct.len;}AllRangeList.AddTail(my_RangeStruct);}}
从List中取元素:
MyRangeStruct myRS;POSITION pos = AllRangeList.GetHeadPosition();AllRangeList.GetNext(pos);while(pos!=NULL){ myRS = AllRangeList.GetNext(pos); //pos 指定的值不变 myRS = AllRangeList.GetAt(pos); //取得下一个pos的值}
0 0
- FMC CList 实例,元素是结构体struct
- go struct结构的实例
- CList删除元素
- 【Struct(结构体)杂谈之七】Struct中0元素数组的意义在哪里?
- 实例讲解c语言结构体大小 sizeof(struct A)
- Clist::find()函数中怎么用结构体
- 结构体(struct) 用法
- 结构体struct module
- 什么结构体 struct
- struct结构体
- struct hostent结构体
- struct hostent结构体
- struct termios结构体
- struct hostent结构体
- 结构体(struct)
- struct termios结构体
- struct device结构体(
- [Matlab]结构体(Struct)
- Task的执行过程分析
- tomcat部署 struts2 File "/struts-tags" not found
- GridView控件事件
- 关于XML字符串和XML Document之间的转换
- 软件工程有多名大三同学被海颐软件录取为实习生
- FMC CList 实例,元素是结构体struct
- jquery mobile 拨打电话
- phoneGap结合android原生代码开发Menu
- 浏览器之四大内核简介
- 万维网、互联网、因特网之间的区别
- linux ssh显示中文乱码
- 软件工程系得到传智播客的大力支持
- 博客已搬家 :D
- sqoop导出hive数据到mysql错误ava.util.NoSuchElementException解决办法