Unnamed
public cpp v1 · immutable#include <string>#include <iostream>using namespace std;string enum_txt(int);int main() { enum kortType { hjerter, spar, ruter, klover }; cout << enum_txt(kortType) << endl;}string enum_txt(int i) { string typer[] = { "hjerter", "spar", "ruter", "klover" }; return typer[i];}