Home > Back-end >  Learning about the map data type C
Learning about the map data type C

Time:09-19

I study in accordance with the above the CSDN tutorials, map<> The data type, know that he is a hash structure, then according to the code on the network retrieval, but an error code is as follows:
//learning map function 
//time: 2020.5.30
//reference:
//1. https://blog.csdn.net/shuzfan/article/details/53115922? Utm_medium=distribute. Pc_relevant. None - task - blog - BlogCommendFromMachineLearnPai2-2. Nonecase& Depth_1 - utm_source=distribute. Pc_relevant. None - task - blog - BlogCommendFromMachineLearnPai2-2. Nonecase
//2. https://www.cnblogs.com/omelet/p/6617362.html

//the code below error
# include
# include

//define the map type variable
Map Id_name;

//for id_name assignment
Map Id_name={
{2015, "WZQ"},
{2022, "222"},
{222, "233"}
};



An error is as follows:


Hope can to solve this bug, thanks.

CodePudding user response:

STL: : map STL: : string
Or
using namespace std;

CodePudding user response:

reference 1/f, the truth is right or wrong response:
STL: : map STL: : string
Or
using namespace std;
thank you I will try

CodePudding user response:

Additional header file
# inlcude & lt; string>//note & lt; string> And & lt; String. H> The difference between
Additional namespace
using namespace std;


  • Related