1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <iostream>
using namespace std;
typedef struct plot {
int num_plot;
map<int, float> map_1;
map<int, float> map_2;
} struct_plot;
typedef struct_plot *pt_plot;
int main(void) {
pt_plot plot;
map<int,float>::iterator it;
plot=((pt_plot)calloc(1,sizeof(struct_plot)));
plot->map_1.insert(std::pair<int,float>(12,300.32));
for (it=plot->map_1.begin() ; it != plot->map_1.end(); it++ ){
cout << (*it).first << " => " << (*it).second << "\n";
}
return EXIT_SUCCESS;
} |
Partager