当前位置: 技术问答>linux和unix
Segmentation fault (core dumped)
来源: 互联网 发布时间:2017-04-19
本文导语: #include #include //#include #include using namespace std; struct userdevice { /* data */ string m_devicename; long m_deviced; int m_devicePopedom; }; typedef multimap USERTABLE; typedef USERTABLE::const_iterator CIT; typedef pair Range; int main() {...
#include
#include
//#include
#include
using namespace std;
struct userdevice
{
/* data */
string m_devicename;
long m_deviced;
int m_devicePopedom;
};
typedef multimap USERTABLE;
typedef USERTABLE::const_iterator CIT;
typedef pair Range;
int main()
{
CIT it;
userdevice d1,d2,d3,d4;
d1.m_devicename="d1";
d1.m_deviced=12341234;
d1.m_devicePopedom=123;
d2.m_devicename="d2";
d2.m_deviced=23622344;
d2.m_devicePopedom=234;
d3.m_devicename="d3";
d3.m_deviced=23451234;
d3.m_devicePopedom=345;
d4.m_devicename="d4";
d4.m_deviced=43622344;
d4.m_devicePopedom=456;
USERTABLE m_user;
m_user.insert(pair ("zhangsanfeng",d1));
m_user.insert(pair ("zhangsanfeng",d2));
m_user.insert(pair ("zhangsanfeng",d3));
m_user.insert(pair ("zhangsanfeng",d4));
Range range=m_user.equal_range("zhangsanfeng");
cout