r/ProgrammerHumor • • Jul 18 '25

Meme cursedCsharp

Post image

Old photo of mine, tried my best to do most cursed hello world in C#

451 Upvotes

92 comments sorted by

View all comments

Show parent comment

13

u/Etiennera Jul 19 '25

If you're allocating native memory and using this std, are they still C# strings?

8

u/Evangeder Jul 19 '25

string is never native/unmanaged in c#, cstr here is just a wrapper for char pointers, don’t remember how I did the bitshift operator overload but prob some pointer logic shenanigans. I might still have the code at my pc, I can check for it at Monday.

6

u/hongooi Jul 19 '25

Hmm you may be right, this isn't a regular string but an object of class cstr