Ok, I believe it has something to do with the dirent.h code, but I may be mistaken.
This is the function,
and it produces this Runtime errorCode:void X_Crypt::PurgeReports() { DIR *d; dirent *dir; std::string file; d = opendir("C:\\C++Projects\\X_Crypt\\reports\\"); if (d) { while ((dir = readdir(d)) != NULL) { file = dir->d_name; if ( file.substr(file.size()-4) == ".xtr" ) { file = "C:\\C++Projects\\X_Crypt\\reports\\" + file; remove(file.c_str()); } } } closedir(d); }
I cant seem to find what the error is in the code. I am very thankful for any assistance you provide.Code:This application has requested the Runtime to terminate in an unusual way.
[edit]
I figured out that the error is the
, but I don't see what is wrong with the code.Code:if ( file.substr(file.length()-4) == ".xtr" )



LinkBack URL
About LinkBacks



