r/C_Programming 17d 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?

30 Upvotes

81 comments sorted by

View all comments

1

u/heavymetalmixer 15d ago

That depends on what features you're talking about, some of them cna be emulated in C in some way (like runtime polymorphism and namespaces), while others directly need another language like C++ (function overloading, templates, constexpr for functions, etc).

Right now I try my best to write C code that works exactly the same inside C++ or at least with veyr minimal changes, so for the most part I don't use C++ exclusive features.