15 Jul, 2009, Scandum wrote in the 1st comment:
Votes: 0
I'm wondering if there is a good and portable way to automatically resize buffers in C, particularly when using vsprintf.

I'm considering asprintf and vasprintf, but I'd rather use alloca than malloc so I don't have to free() stuff myself, unless someone knows of an easy way to automatically free memory the moment it gets out of scope.

I guess it's also an option to make the code c++ compatible and using c++'s string library? I've never gone that route before so I'm not sure how much work that'd entail.
15 Jul, 2009, David Haley wrote in the 2nd comment:
Votes: 0
Using C++ is a piece of cake. Far easier solution unless you really have to stay in C only.
15 Jul, 2009, Runter wrote in the 3rd comment:
Votes: 0
http://en.wikipedia.org/wiki/Boehm_garba...

Also the cords string library is pretty nice.
15 Jul, 2009, Scandum wrote in the 4th comment:
Votes: 0
Given it's for TinTin++ portability is an issue, but I assume g++ is as widely available as gcc. Any suggestions for a good online c++ manual that has a section on strings?
15 Jul, 2009, Runter wrote in the 5th comment:
Votes: 0
Decent reference if you already have som...

Decent mix of examples and documentation.
15 Jul, 2009, Scandum wrote in the 6th comment:
Votes: 0
Thanks, that looks pretty useful.
15 Jul, 2009, David Haley wrote in the 7th comment:
Votes: 0
Depending on what you're actually doing with this, you might want to also look into streams, like string-backed streams (osstream or ostrstream, IIRC, depending on which version of the STL you're using).
15 Jul, 2009, Scandum wrote in the 8th comment:
Votes: 0
I'll definitely look into those as well. I've been holding off on switching to c++ entirely too long.
0.0/8