3 ms·
If you look later on at the readme, you'll see that the stx_catf function does not reallocate, it truncates, there is another function for reallocating append.
by wheybags 6y ago
If you look later on at the readme, you'll see that the stx_catf function does not reallocate, it truncates, there is another function for reallocating append.
That said, I don't really see why one would need such a no-realloc function. In c++, I would just use std::string::reserve(some_big_num).
- gkfasdfasdf 6y agostx_new allocates the string, per the readme. My point is that the readme example is misleading, as the two code samples are not equivalent.
- alcover 6y agoYou are right, I changed it to malloc. This 'long way' thing is definitly not super useful..