1. ## Two questions??

1) Borland C++ or Visual C++. I've used Borland before but I might need to do some low-level display work (e.g. plot a graph etc). Is there any performance difference between the two. Which would be easier to handle C++ stuff and also help with a little bit of graphics?

2) I've decided to use a MULTIMAP for a sequence comparision comparision program. The data structures are:
Code:
```struct COORD
{
int x, y;  //for the coordinates
char Letter;      //for character name
};

multimap <COORD, int> Nodes;  //the int is the 'key'```
The problem is that the key is not unique. Here're some values in the multimap:

x=1,y=2 ; Letter=A ; Key=1
x=3,y=7 ; Letter=A ; Key=4
x=4,y=7 ; Letter=B ; Key=3
x=5,y=8 ; Letter=B ; Key=3
x=6,y=9 ; Letter=C ; Key=3
x=6,y=11; Letter=A ; Key=5

The key is basically (y - x). Now, I want to use an iterator to the MULTIMAP and pick out all keys with the same value (e.g. Key = 3) and then store these values in another multimap. Problem is I don't know the value of the key from before. I just know there will be repititions but I don't know what those values are.

Also, how do I store the entries that I get from the MULTIMAP, given that I don't know how many of each Key I have?

Thanks!

Edit:

Ok, I realize that I could get around this by storing all the keys in a vector while I'm populating the multimap. The problem is I only want to have unique keys in the vector, no repititions. Is there a way where I could simply push something on a vector (or something else) and if the element already exists then it's simply overwritten. I don't want to do comparisions to do the same cause that would add needless computations to my program.

2. Is it true that while inserting into a map if they keys are the same (as above), previous data will be overwritten? If so, then how do I get to the stage above i.e.
Code:
```x=1,y=2 ; Letter=A ; Key=1
x=3,y=7 ; Letter=A ; Key=4
x=4,y=7 ; Letter=B ; Key=3
x=5,y=8 ; Letter=B ; Key=3
x=6,y=9 ; Letter=C ; Key=3
x=6,y=11; Letter=A ; Key=5```

3. A multimap can store multiple values with the same keys. A map cannot.

I believe that Visual C++ produces slightly faster code than Borland C++, but I'm not sure. The difference will not be big.

4. oh ok...So, what's the best way to pick out all keys with the same value (e.g. Key = 3) and then store these MAP entries in another data structure; given that I don't know the key values beforehand.

Also, in the Visual C++ vs. Borland C++ case, I'm interested in speed, and internal functions for graphics (e.g. the chart function in MATLAB where I just give the program coordinates and MATLAB makes the graph for me)

5. Neither compiler has internal functions for graphics. You can use the low-level graphics functions of the GDI, or you get a real graphing library. Neither ought to be compiler-bound.

What do you mean, you don't know the key?

6. Regarding the VC++ thing, I want to know which supports plotting graphs in the most efficient manner possible.

I have several values for keys, e.g. -3, -1, -1, 2, 3, 3, 3, 4 like that...but let's say i use find() for the multimap, i won't know what value to use to find the corresponding entry. What I want to be able to do is to find all multiple-key entries (e.g. 3 above) and single key entries and then store then store those records somewhere else. Simply, how to use find() in this case.

7. You don't use find. You use find to find the element(s) corresponding to known keys. In your situation, you iterator through the whole map and dispatch elements to other maps based on their key.

8. ya i was hoping there was a simpler way...this way i have to make another map that stores only the single keys and then compare these against the multimap keys when i want to do the transfer...one question though: When I insert numbers (key) in a MAP, if these numbers are not unique (e.g. 1,2,2,3,3,3,3,4,5) in the end the entries in my map will be:

a) 1,2,2,3,3,3,3,4,5 OR
b) 1,2,3,4,5

as in will i get overwrites for the key? (b) is what I'm looking for.

9. A std::map will overwrite the values of the key.