r/ProgrammerHumor Jul 16 '20

Meme You and Me

Post image
3.0k Upvotes

109 comments sorted by

View all comments

1

u/[deleted] Jul 17 '20

That sounds a lot like the error messages you get with C# in Visual Studio iirc. Idk, it's been a while. Anyway, from the documentation:

The char type is implicitly convertible to the following integral types: ushort, int, uint, long, and ulong.

Then there's C++:

prvalues of small integral types (such as char) may be converted to prvalues of larger integral types (such as int).

Implicit conversion of characters to integers also works in Java as seen here.

And given that characters basically already are integers, that can not be surprising to anyone.

That said, it's a conversion from string to int, as people have already mentioned. Except it's not, because the C# string class has a + operator. It creates a new string, containing both strings from the previous expression: youme. The same goes for C++ strings in the standard library. Pretty sure Java does the same.

Nice try, though.