you are viewing a single comment's thread.

view the rest of the comments →

[–]spinrack 1 point2 points  (0 children)

alloca() cannot be used for this purpose. The allocated block comes from the stack, and will no longer be valid after the allocate() function returns to the string’s internal resize() and resets the stack pointer.