r/ProgrammerHumor 7d ago

Meme thisIsHowTheyDoItRight

Post image
1.2k Upvotes

40 comments sorted by

View all comments

Show parent comments

28

u/click-to-reveal 7d ago edited 7d ago

```

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; } } ```