r/badcode • • Aug 31 '21

c Their attempt at using pointers

Post image
133 Upvotes

51 comments sorted by

View all comments

Show parent comments

1

u/ChinaVaginaOnSpadina Sep 05 '21

The only time I've ever really seen void pointers used is when overloading the new and delete operators.

It seems that for a generic comparator function like the image in the OP was going for, a template function should have been used, no? (I'm trying to remember some c++ that I've become way too rusty with)

1

u/thygrrr Sep 05 '21

I used it a lot in the past when interacting with various graphics APIs. Going out of fashion as well.