Hi @Markus Freitag ,
There are several ways to initialize the map:
map<string, int> m1;
m1[string("abc")] = 1;
m1[string("defg")] = 2;
map<string, int> m2;
m2.insert({ string("abc"), 1 });
m2.insert(make_pair(string("defg"), 2));
m2.insert(pair<string, int>(string("hijk"), 3));
References are often used for function parameter lists and function return values.
Best regards,
Elya
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.