Click here to Skip to main content
15,913,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Little doubts Pin
Member 154898328-Mar-05 15:35
Member 154898328-Mar-05 15:35 
GeneralRe: Little doubts Pin
toxcct28-Mar-05 19:01
toxcct28-Mar-05 19:01 
GeneralRe: Little doubts Pin
David Crow29-Mar-05 4:59
David Crow29-Mar-05 4:59 
GeneralRe: Little doubts Pin
Gary R. Wheeler28-Mar-05 15:26
Gary R. Wheeler28-Mar-05 15:26 
GeneralRe: Little doubts Pin
Zdeslav Vojkovic29-Mar-05 2:44
Zdeslav Vojkovic29-Mar-05 2:44 
GeneralRe: Little doubts Pin
David Crow29-Mar-05 5:07
David Crow29-Mar-05 5:07 
GeneralUnable to do incremental builds Pin
ljr2428-Mar-05 14:39
ljr2428-Mar-05 14:39 
GeneralNewbie in geekland needs help with STL Pin
knapak28-Mar-05 14:17
knapak28-Mar-05 14:17 
Hi-- I've been banging my head trying to solve this problem. Of course I'm a self trained pseudo programmer who just started to use STL. I have a huge file with 10 million entries that are paired, say 1 , 8 ; 1 , 5; 1 , 3; 2 , 0; 2 , 4; 3 , 0; 3 , 8; etc... They are stored as a two dimensional array of 10 million rows and two columns... you get the idea of the data. I need to find the records in the file that have one and only one of the tags in the first entry of the pair and put the second in another vector file in the order found. For example, if I need records with the tag 2, I'll create a vector with 0 and 4. I suppose I need to use a multimap, but do not know how to read the file and then store the results in a vector. Right now I have this simple code:

typedef vector<double> DVECTOR;
DVECTOR FDV;
int tag;
double FD;
int id = 3;
int idp = id + 1;

while(tag != idp)
{
GetData >> tag >> FD;
cout << tag << " " << FD << endl ;
if(tag == id)
FDV.push_back(FD);
}

This does what I want by scaning the file from the begining until it finds the target value and reads all the entries with such value. If the number is close to the first entry, cool it's fast, but if it is near the end it will take a long time (big program repeated many times...). The question is, would the multimap work better and faster to do the same task? If so... how do I do it???

Thank you so much!

Carlos
QuestionHow to disconnect (using CInternetSession, ChttpConnection, Chttpfile) Pin
bigbby28-Mar-05 14:17
bigbby28-Mar-05 14:17 
GeneralLinker Error Pin
SandeepN28-Mar-05 14:13
SandeepN28-Mar-05 14:13 
GeneralMySpell Pin
rjnl28-Mar-05 14:06
rjnl28-Mar-05 14:06 
GeneralRe: MySpell Pin
David Crow29-Mar-05 3:15
David Crow29-Mar-05 3:15 
GeneralRe: MySpell Pin
rjnl29-Mar-05 10:46
rjnl29-Mar-05 10:46 
GeneralRe: MySpell Pin
David Crow29-Mar-05 10:50
David Crow29-Mar-05 10:50 
GeneralCustomizing the menu items Pin
rjnl28-Mar-05 13:55
rjnl28-Mar-05 13:55 
GeneralRecommendations on C++ books. Pin
BRIMID28-Mar-05 13:33
BRIMID28-Mar-05 13:33 
GeneralRe: Recommendations on C++ books. Pin
Alexander M.,29-Mar-05 3:00
Alexander M.,29-Mar-05 3:00 
Generalunique number Pin
Shotgun28-Mar-05 12:50
Shotgun28-Mar-05 12:50 
GeneralRe: unique number Pin
Alexander M.,28-Mar-05 13:25
Alexander M.,28-Mar-05 13:25 
GeneralRe: unique number Pin
Shotgun28-Mar-05 13:34
Shotgun28-Mar-05 13:34 
GeneralRe: unique number Pin
Gary R. Wheeler28-Mar-05 15:38
Gary R. Wheeler28-Mar-05 15:38 
GeneralVC++.NET - Build vs Rebuild vs Clean Pin
JSadleir28-Mar-05 12:42
JSadleir28-Mar-05 12:42 
GeneralRe: VC++.NET - Build vs Rebuild vs Clean Pin
Alexander M.,28-Mar-05 13:29
Alexander M.,28-Mar-05 13:29 
GeneralShowing DLL function name references in Visual Studio Debugger Pin
ljr2428-Mar-05 12:20
ljr2428-Mar-05 12:20 
GeneralRe: Showing DLL function name references in Visual Studio Debugger Pin
Alexander M.,28-Mar-05 13:30
Alexander M.,28-Mar-05 13:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.