Peta@wiki
C++<vector>
最終更新:
匿名ユーザー
-
view
C++で用いられるVector型の使い方
size分の初期化
int size = 10;
vector<double> temp
temp.resize(size)
vector<double> temp
temp.resize(size)
サイズのgetを行う
int size2 = temp.size();
クラスで用いる場合
vector型をreturnをする場合
vector<double>& getVector() const {return (vector型の変数);}
vector<double>& getVector() const {return (vector型の変数);}
vector型を呼び出す場合
void useVector(vector<double>& vect){中身};
void useVector(vector<double>& vect){中身};