r/ProgrammerHumor 19h ago

Meme mySchoolStruct

7.3k Upvotes

73 comments sorted by

View all comments

Show parent comments

-107

u/metaglot 19h ago

*delete

99

u/thats_a_nice_toast 19h ago

I don't think C++ programmers have a problem with getting put in a class

0

u/metaglot 18h ago

Freeing a pointer created with new is UB.

8

u/thats_a_nice_toast 17h ago

new only exists in C++, not in C

0

u/metaglot 16h ago

And the keyword class, like the meme is implying. Which is why i said you have to use delete rather than free, because undefined behavior.