C++ help

profileARapSal
sample.txt

#include <iostream> //The library of IO functions #include <fstream> //The library of external stream functions #include <cstdlib> //The library for external errors #include <string> //The library for string functions #include <cmath> //The library of C math functions #include <stdlib.h> #include <stdio.h> #include <iomanip> #include <vector> using namespace std; int main(){ ifstream fin; string filename = "file.txt"; fin.open(filename); char letter; string line; vector<string> str; vector<string> ::iterator ptr; string sub1; string sub01; string sub2; string sub02; while (!fin.eof()){ getline(fin, line); //getline()(fin, line); //line.push_back(letter); if (line.length() >= 6){ str.push_back(line); for (int i = 0; i != str.size(); i++){ // cout << str.at(i) << endl; sub1 = str.at(i); sub01 = sub1.substr(0, 5); for (int j = 1; j = str.size(); j++){ sub2 = str.at(j); sub02 = sub2.substr(0, 5); } if (sub01 == sub02 ){ cout << "true"; } } // end out if } } fin.close(); system("pause"); }