Hi all, i am trying to write a program to help me manage word lists, basically just merge 2 word lists together, and filter out the double words...
but one problem i can see coming is that some word lists can be quite large, some up to several gigabytes, normally when i have written programs to manipulate data i have been working with databases which are tiny in comparison. so i really have no idea on how to handle such large amounts of data.
below i have posted what i have done so far... where the words out of the word list are stored in the string array called temp. but as you can see it isn't vary practical at all... any suggestion on how i could get around this problem???
Code:#include <cstdlib> #include <iostream> #include <fstream> using namespace std; int main(int argc, char *argv[]) { string temp[100]; ifstream wordlist_in; wordlist_in.open (argv[1]); if (wordlist_in.is_open()) { for (int i=0;;i++) { getline (wordlist_in, temp[i]); if (wordlist_in.eof()) { break; } } } return EXIT_SUCCESS; }