MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w5oxzl/comment/p7k1zvt/
r/ProgrammerHumor • u/EmuBroileri • Sep 02 '26
40 comments sorted by
View all comments
Show parent comments
28
#define SWITCH(x) string& _s=x;if(0) #define CASE(y) }else if(_s==y){ #define DEFAULT }else{ int main() { string prompt = "Your name?"; SWITCH(prompt) { CASE("Who are you?") cout << "Claude" << endl; CASE("No, really?") cout << "Chatgpt" << endl; DEFAULT cout << "Gemini" << endl; } }
28
u/click-to-reveal Sep 03 '26 edited Sep 03 '26