Hi,
I am trying to make a Look Up Table (LUT) of file quotes.
I have several .txt files with different names. Every txt file is full of fingerprints (n lines, each line is a number which goes from 0 to 1048576, every line is a fingerprint).
Example, "TheBlackWizard.txt" is:
218487
228012
5955
263893
429090
...
|
I want to make a LUT where the fingeprint number is used as the table's index,at that precise index there will be several quotes.
For Example, after inserting in the lut TheBlackWizard.txt, the LUT will be:
LUT[218487] = TheBlackWizard, 1
LUT[228012] = TheBlackWizard, 2
LUT[5955] = TheBlackWizard, 3
LUT[263893] = TheBlackWizard, 4
LUT[429090] = TheBlackWizard, 5 |
...
I managed to run few insertions in the LUT using Push and Pop function, but now I am stucked.
I want to see the whole current LUT[5955]on the display, using front() or back() let me see just the first or the last elements.
How can I see the full list ?
I searched a lot on the C++ Programming book and over the internet with no results.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
#include <iostream>
#include <string>
#include <list>
#include <fstream>
using namespace std;
class coord{
string nomefilm;
long index;
long finga;
public:
//Setters & Getters
long set_finga(long f){
this->finga = f;
}
long get_finga(){
return this->finga;
}
void set_nomefilm( string n){
this->nomefilm = n;
}
string get_nomefilm(){
return this->nomefilm;
}
void set_index(long i){
this->index = i;
}
long get_index(){
return this->index;
}
};
int main(int argc, char** argv)
{
cout << "Start! " << endl;
list<coord> LUT[1048576];
cout << "I am not crashed!" << endl;
cout << "Tell me the name "<<endl;
string nome;
cin >> nome;
int m;
long index;
cout << "From what point u wanna start? "<< endl;
cin >> m;
for (index=m;index<99999999;index++){
cout << "Insert (0-1048576) for line# " << index<< endl;
long finga;
cin >> finga;
coord myCoord;
myCoord.set_finga(finga);
myCoord.set_index(index);
myCoord.set_nomefilm(nome);
LUT[finga].push_back(myCoord);
string text ;
text = "hello" ;
cout << "String is : " << text << endl ;
cout << endl;
cout << "LUT["<<finga<<"]: nomefilm \t"<<LUT[finga].front().get_nomefilm() <<"\t index \t"<<LUT[finga].front().get_index()<<LUT[finga].back().get_index()<<endl;
cout << LUT[finga] << endl;
}
return 0;
}
|
I am using Ubuntu and Geany to compile it.
It says:
77: error: no match for ‘operator<<’ in ‘std::cout << LUT[finga]’ |