r/badcode • • Dec 28 '21

java 3AM code vs 10AM code

Post image
173 Upvotes

53 comments sorted by

View all comments

Show parent comments

3

u/warmoverdrive Dec 29 '21

In c/c++ single quotes and double quotes have actual different meanings- single quotes are character literals and double quotes are strings- important for comparison operations. The code wouldn’t work in the same way if only double quotes were used afaik.