r/C_Programming • u/Gullible_Ostrich_370 • Jul 17 '26
C with classes
I'm curious to know: who uses some C++ features when coding in C? And what feature(s) are you using?
29
Upvotes
r/C_Programming • u/Gullible_Ostrich_370 • Jul 17 '26
I'm curious to know: who uses some C++ features when coding in C? And what feature(s) are you using?
View all comments
Show parent comment
11
u/mykesx Jul 18 '26
I wish we had member functions in structures. Nothing fancy, just pass this as first argument. No overloading, no inheritance, no polymorphism.
It would make things like
FILE *fp = fopen(...);
fp->gets(buf, size);