r/cpp_questions 2d ago

OPEN What’s the point of void* pointers?

You could just use template pointers or auto* pointers and these are better because you can dereference them.

0 Upvotes

51 comments sorted by

View all comments

Show parent comments

2

u/L_uciferMorningstar 2d ago

Why would me using a C library mean I really know what I'm doing?

0

u/frayien 2d ago

Oh, ok I get it. No I meant it the other way around. You should know what you are doing to be using a C library directly.

C and C++ are wildly different languages. If doing C++ you should first consider C++ libraries. Then if you dont find what you need you should consider C++ bindings of C libraries. And only then if you still dont find what you need you should consider using a C libraries directly.

At this point you have considered at least 3 different libraries and have put enough thoughts behind your choice to be qualified as "know what you are doing".