Hi,
I've got the following code:
Code:CString input; bool found = false; fstream myfile; myfile.open(filetoopen,ios::in); while(!myfile.eof()){ myfile.getline(input.GetBuffer(250),249,"\n"); input.ReleaseBuffer(); found=false; for(int i=0;i<filebuffer.GetSize();i++){ if(filebuffer.GetAt(i)==input){ found=true; break; } } if(found) linecnt.assign(i,(linecnt.at(i)+=1)); else{ filebuffer.Add(input); //THIS LINE CAUSES THE ERROR APPARENTLY? linecnt.push_back(1); } }
I've found the line causing the problem simply by commenting out certain chunks until I've got it down to that. Although I REALLY can't see why this could cause a problem in the slightest! Any help would be appreciated...
Thanks!