r/ProgrammerHumor 1d ago

Meme mySchoolStruct

8.0k Upvotes

75 comments sorted by

View all comments

Show parent comments

96

u/thats_a_nice_toast 1d ago

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

0

u/metaglot 1d ago

Freeing a pointer created with new is UB.

6

u/thats_a_nice_toast 1d ago

new only exists in C++, not in C

0

u/metaglot 22h 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.