Simple dictionary in C++

前端 未结 8 1087

Moving some code from Python to C++.

BASEPAIRS = { \"T\": \"A\", \"A\": \"T\", \"G\": \"C\", \"C\": \"G\" }

Thinking maps might be overkill? W

8条回答
  •  一整个雨季
    2021-01-30 16:59

    You can use the following syntax:

    #include 
    
    std::map my_map = {
        { 'A', '1' },
        { 'B', '2' },
        { 'C', '3' }
    };
    

提交回复
热议问题