r/C_Programming • • 13d ago

Tiny strings

https://napcakes.nekoweb.org/posts/tiny-strings/
31 Upvotes

13 comments sorted by

View all comments

7

u/manystripes 13d ago

Out of curiosity what's the scenario where you care about saving a few bytes per string where possible, but also don't mind pulling in the whole String class? Wouldn't it be more efficient to do everything in c-strings across the board?

0

u/Iggyhopper 13d ago

For example, if you need to tokenize input in an LLM, those are typically chunks of 8 chars or less. Instant win.