3 ms·
Honestly just use memcopy and define your own string structure. C has void*, that allows you to implement easily modifiable data structures. There is a bit of
by orwin 3y ago
Honestly just use memcopy and define your own string structure.
C has void*, that allows you to implement easily modifiable data structures. There is a bit of 'NIH' syndrome in what I'm saying, I'll admit, but in the end it's better imho.
- jstimpfle 3y agoC is all about memory management and copying data around, and people can't stop whining that there is no magic string handling sauce (as if strings were special), and keep acting like we had to put up with the ridiculous strcat() etc. nonsense.
- jacquesm 3y agoThat's not what 'void*' is for.
- orwin 3y agoThat's how I use it though. As a data-agnostic type, so I can put whatever I like in my btrees/buffers/linked lists. I don't use it for string management, I guess reading my post again, I expressed myself poorly, again.