相关疑难解决方法(0)

调试时堆栈溢出但未释放

我在下面有以下代码,它解析文本文件并索引单词和行:

bool Database::addFromFileToListAndIndex(string path, BSTIndex* & index, list<Line *> & myList)
{
    bool result = false;
    ifstream txtFile;
    txtFile.open(path, ifstream::in);
    char line[200];
    Line * ln;
    //if path is valid AND is not already in the list then add it
    if(txtFile.is_open() && (find(textFilePaths.begin(), textFilePaths.end(), path) == textFilePaths.end())) //the path is valid
    {
        //Add the path to the list of file paths
        textFilePaths.push_back(path);
        int lineNumber = 1;
        while(!txtFile.eof())
        {
            txtFile.getline(line, 200);
            ln = new Line(line, path, lineNumber);
            if(ln->getLine() != "")
            {
                lineNumber++; …
Run Code Online (Sandbox Code Playgroud)

c++ stack-overflow

4
推荐指数
1
解决办法
846
查看次数

标签 统计

c++ ×1

stack-overflow ×1