在发布模式下InputStringString访问冲突但不调试

时间:2011-12-13 15:40:07

标签: c++ access-violation

目前有一个问题,程序在使用MSVS2010的调试模式下编译和运行正常,但是当我切换到发布模式时,它会在运行时崩溃并在无限内存地址处发生访问冲突。这是代码,其中包含程序在发布模式下爆炸的注释。它与inputstringstream运算符有关。

std::ifstream fileIn(filename);

    //File was unable to be found
    if(!fileIn){
        std::cout << "Unable to open the specified file";
        exit(1);
    }
    std::string line;
    //Else if the file has been found read in the values and build a mesh
    while(getline(fileIn,line)){
        char Charsub;
        std::string sub;
        std::istringstream iss(line);
        //Program blows up with access violation @ 0xfffffffffffff on the next line, but only in release mode, not debug
        iss >> sub;

0 个答案:

没有答案