Add
Adds One element at the end of the vector.
int Add( _TemplType element )
The index of the added element.
EX1
//Add double data to double vector. void vector_Add_ex1() { vector<double> vD = {1.1, 2.2}; double d = (3.999); vD.Add(d); for(int ii = 0; ii < vD.GetSize(); ii++) { printf("vD[%d]= %f\n", ii, vD[ii]); } }
EX2
//Add string to string vector. void vector_Add_ex2() { vector<string> vsExt = {"OPJ", "TXT"}; vsExt.Add("SPC"); for(int ii = 0; ii < vsExt.GetSize(); ii++) { printf("Extesion(%d) : %s\n", ii, vsExt[ii]); } }
EX3
//Add complex to complex vector void vector_Add_ex3() { vector<complex> vC; complex cc(4.3, 5.6); vC.Add(cc); //Add cc to vC for(int ii = 0; ii < vC.GetSize(); ii++) out_complex("value=", vC[ii]); }
vector::InsertAt
origin.h