Home > Back-end > C about how to define a map in the header file, and then how to reference in the source file (my) CP
C about how to define a map in the header file, and then how to reference in the source file (my) CP
Time:09-22
Want to in the header file (my. H) in a map type is used to establish a STD: : map My_Map
And define my_Map [" one "]=1; My_Map (" two ")=2; My_Map (" three ")=3; "Four" my_Map []=1;
And in the CPP (my) CPP) file # include "" my h" "
In the process of compile the center daily news Error: 'my_Map' does not name a type my_Map [" one "]=1; Error: 'my_Map' does not name a type my_Map [" two "]=1; Error: 'my_Map' does not name a type my_Map [" three "]=1; Error: 'my_Map' does not name a type my_Map [" four "]=1;
Consult a great god this is the reason why is my_Map define what's the problem? In the header file in how to define a map, and then how to reference in the source file (my) CPP)? Pray god grant instruction