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
2
u/flewanderbreeze Jul 18 '26
ah I think I nearly got what a slice is, it basically is just a fat pointer to a type T, but what I didn't quite understand, given you have an arraylist/vector of a struct like vector2, how do you define how much bytes you want a slice out of it? and how do you manage to not cut in the middle of something?
I think I need to understand the true applications of a slice to really understand how to implement it
I have already implemented a really fast generic vector/arraylist, and I can't really find an application for a slice where an arraylist wouldn't suffice