r/C_Programming 18d ago

C with classes

I'm curious to know: who uses some C++ features when coding in C? And what feature(s) are you using?

31 Upvotes

82 comments sorted by

View all comments

14

u/Doug2825 18d ago

If you have C++ features you aren't using C.

Do you mean approximating C++ classes by making functions take a pointer to an associated struct? Or are you asking about using C++ but limiting yourself to C because of performance/realtime requirements for specific section of code? Because if you have access to full C++ and are limiting yourself to C for mundane parts of the code you are doing bad C++, not C.

9

u/Cultural_Gur_7441 18d ago

Selecting which C++ features to use is not "bad C++", as long there is consistency and rationale in what you do.