Simple dictionary in C++

前端 未结 8 1101

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

    A table out of char array:

    char map[256] = { 0 };
    map['T'] = 'A'; 
    map['A'] = 'T';
    map['C'] = 'G';
    map['G'] = 'C';
    /* .... */
    

提交回复
热议问题