zoukankan      html  css  js  c++  java
  • program files (x86)\microsoft visual studio 14.0\vc\include\xtree,如果没有找到,下标溢出了,就报错咯

    ---------------------------
    Microsoft Visual C++ Runtime Library
    ---------------------------
    Debug Assertion Failed!

    Program: C:\Windows\SYSTEM32\MSVCP140D.dll
    File: d:\program files (x86)\microsoft visual studio 14.0\vc\include\xtree
    Line: 238

    Expression: map/set iterator not dereferencable

    For information on how your program can cause an assertion
    failure, see the Visual C++ documentation on asserts.

    (Press Retry to debug the application)

    ---------------------------
    中止(A) 重试(R) 忽略(I)
    ---------------------------

    int main()
    {
    //set<string> names;//不写,是默认的二元谓词,区分大小写
    set<string,CCompareStringNoCase> names;//不区分大小写,二元谓词可以改变容器的默认的行为
    //cout << "hello" << endl;
    names.insert("Tina");
    names.insert("jim");
    names.insert("Jack");
    names.insert("Sam");
    names.insert("hello");
    //set<string>::iterator iNameFound = names.find("Jim");
    set<string,CCompareStringNoCase>::iterator iNameFound = names.find("1im");
    if (iNameFound != names.end())
    {
    cout << "找到了。。。" << *iNameFound << endl;
    }
    else
    {
    cout << "没找到。。。" << endl;
    //cout << "没找到。。。" << *iNameFound << endl;//----------------------------如果没有找到,下标溢出了,就报错咯
    }
    getchar();
    return 0;
    }

    欢迎讨论,相互学习。 txwtech@163.com
  • 相关阅读:
    AVX2整数向量运算
    AVX2浮点向量运算
    AVX2浮点向量运算
    二进制128位整数运算
    二进制128位整数运算
    CCF201512-2 消除类游戏(100分)
    CCF201512-2 消除类游戏(100分)
    CCF201312--模拟练习试题参考答案(Java)
    CCF201312--模拟练习试题参考答案(Java)
    CCF认证历年试题集
  • 原文地址:https://www.cnblogs.com/txwtech/p/12114557.html
Copyright © 2011-2022 走看看