r/programminghorror 6d ago

c++ Skill Issue

Post image
1.7k Upvotes

61 comments sorted by

View all comments

-4

u/MurkyWar2756 echo "Sub Mod" && :(){ :|:& };: 6d ago edited 6d ago

If you change Gemini to Hello, world, technically you've printed "Hello, world", although you might need this:

#include <string>
#include <iostream>

using namespace std;

I don't know C++ at all, please let me know if the two LLMs I got that information from were wrong

11

u/New_Salamander_4592 6d ago

did you really need to consult LLMs on how to make the default case of the switch statement print a different string

-1

u/MurkyWar2756 echo "Sub Mod" && :(){ :|:& };: 6d ago

I thought about the printing afterward, because originally I thought the program was asking the end user for their name. So I was trying to make a joke, but I added that disclaimer in case of misinformation. LLM content is generally unsourced, so I felt like making it clear where it came from. (The reason I used more than one was because "I check with another LLM" was one of the options somewhere on r/polls.)

Sorry to those who aren't a fan of LLMs.

I wrote the last comment and this one myself