単にサイズ拡大して領域確保しなおしたいなら realloc にするべきだし、そうではなくスタック上の領域を可変に確保したいのならそもそもそれは間違っている、ということになる
最大でたかだか要素数 100 くらい vector みたいなのがスタックにほしい!とかはわからんでもないけど最大要素数見積もれるならそもそもその最大で固定で確保したほうが事故がないしエラーハンドルが減るしメモリ使用量見積もりやすくなる
Mastodon is the best way to keep up with what's happening.
Follow anyone across the fediverse and see it all in chronological order. No algorithms, ads, or clickbait in sight.