アットウィキロゴ

要素確保

[20xx/xx/xx]
【問題】
vectorの要素を動的に確保する。

【解決策】
resizeを用いる。
vector <int> vec;
    //10個の要素を確保する
    vec.resize(10);

【関連記事/参照URL】
vector::resize

タグ:

+ タグ編集
  • タグ:
最終更新:2013年10月03日 04:48