私はCが初めてで、enumが本当にいいと思いました。私のプログラムは文字列を取得し、列挙型を使用してケースを処理します。その後、(時々) 列挙型テーブルの文字列と一致する文字列を送り返す必要があります。列挙型でそれを行う方法はありますか、それともルックアップテーブルを使用する必要がありますか? このようなもの
typedef enum {
string1,
string2,
string3,
string4,
BADKEY
} strings;
function(string1); //will send the integer,
//but would love to be able to send the string.
function(char *string) {
...
}