For example.
float test[2];
map < string, "what should I put here?" > myMap;
I want a map where keys are string, and values are array of float in size 2. I can use vector <float>, but I don't want to use vectors.
For example.
float test[2];
map < string, "what should I put here?" > myMap;
I want a map where keys are string, and values are array of float in size 2. I can use vector <float>, but I don't want to use vectors.
I believe (I had to try a little example) that it's float*
float a[2] = {4.0,5.7};
float b[2] = {1.3,9.8};
string label1 = "label1";
string label2 = "label2";
map<string, float *> mymap;
mymap[label1] = a;
mymap[label2] = b;
cout <<mymap[label1][1]<<endl;
output is 5.7
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.