Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Memory errors HELP!
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Daniel T., post: 2544035"] Or better yet... int main( ) { ifstream inf( MOVEX_QUERY ); vector<Document> documents; Document doc; while ( getline( inf, doc.name, ',' ) && getline( inf, doc.edition ) ) documents.push_back( doc ); // do what you will to the documents... } From what I think I know about the OP's problem to solve, a map may make more sense... int main( ) { ifstream inf( MOVEX_QUERY ); map<string, string> documents; string doc; string edi; while ( getline( inf, doc, ',' ) && getline( inf, edi ) ) { if ( documents.count( doc ) == 0 ) documents.insert( make_pair( doc, edi ) ); else cout << "duplicate entry found\n"; // what to do here? } The above will make it easer to compare the edition of a document from this file, to the edition of the same document of the other file. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Memory errors HELP!
Top