No, I have outputed rawData[9] as well, whilst debugging, and it is exactly what it should be. In fact I have outputted the entire vector, and everything is correct. If you would like me to post some more code then sure. : )
I input into the vector with this function:
signed int FileSystem::readFromFile(){
std::string tmp = selectedFilePath.toStdString();//selectedFilePath is a QString of file path I am going to read. It is initalized else where in the program.
std::ifstream ifs;
ifs.open( tmp.c_str() );
if( ifs.is_open() ){
while( getline( ifs , tmp ) ){
if(rawData.size() < MAX_LINES){ // Max_SIZE is a constant I define elsewhere in the program.
rawData.
push_back( QString::fromStdString( tmp
) );
//Enter data into vector. }
}
return EXIT_SUCCESS;
}
else return EXIT_FAILURE;
}
signed int FileSystem::readFromFile(){
std::string tmp = selectedFilePath.toStdString();//selectedFilePath is a QString of file path I am going to read. It is initalized else where in the program.
std::ifstream ifs;
ifs.open( tmp.c_str() );
if( ifs.is_open() ){
while( getline( ifs , tmp ) ){
if(rawData.size() < MAX_LINES){ // Max_SIZE is a constant I define elsewhere in the program.
rawData.push_back( QString::fromStdString( tmp ) );//Enter data into vector.
}
}
return EXIT_SUCCESS;
}
else return EXIT_FAILURE;
}
To copy to clipboard, switch view to plain text mode
Again, I have outputted the vector and everything is correct. It is quite confusing. :/
Bookmarks