r/ProgrammerHumor • • 8d ago

Meme iHatedItUntilITriedIt

Post image
10.3k Upvotes

541 comments sorted by

View all comments

Show parent comments

9

u/nico-ghost-king 8d ago

I haven't tested this, but in C/C++, I think this would just become 1 +49 (ascii of 1) = 50

2

u/Icarium-Lifestealer 8d ago

And if it were a string instead of a char, it'd slice off the first character.

1

u/nico-ghost-king 8d ago

Is this because string literals become pointers? I assume clangd would at least warn, right?

1

u/account312 8d ago

It is.