D
d.avitabile
Hi everybody,
I have defined a standard map as follows
map<int,double> nonzeroEntries;
because I wanted to take advantage of the container class. Now I have
a function with the following interface
myfunction( int * theIntegersInTheMap, double * theDoublesInTheMap);
therefore I need pointers to the key list and to the value list. Is
there any smart way to do this? At the moment I create two pointers
int * theIntegers = new int[sizeOfTheList];
double * theIntegers = new double[sizeOfTheList];
and fill them in, but this solution seems a bit redundant.
In case you didn't get it... I'm a total newbie in maps.
Thanks in advance
I have defined a standard map as follows
map<int,double> nonzeroEntries;
because I wanted to take advantage of the container class. Now I have
a function with the following interface
myfunction( int * theIntegersInTheMap, double * theDoublesInTheMap);
therefore I need pointers to the key list and to the value list. Is
there any smart way to do this? At the moment I create two pointers
int * theIntegers = new int[sizeOfTheList];
double * theIntegers = new double[sizeOfTheList];
and fill them in, but this solution seems a bit redundant.
In case you didn't get it... I'm a total newbie in maps.
Thanks in advance