2007-10-26から1日間の記事一覧

stringのswitch(のようなもの)

C++

matsutakegohan1の日記 - 関数をmapに 現在のC++ではswitchにstringを使用することはできない void func1() { cout << "func1" << endl; } void func2() { cout << "func2" << endl; } int main() { string str; switch (str) { // エラー! case "abc": fun…