| VF_insert | VD_insert | VE_insert |
| VCF_insert | VCD_insert | VCE_insert |
| VPF_insert | VPD_insert | VPE_insert |
| VI_insert | VBI_insert | VSI_insert | VLI_insert | VQI_insert |
| VU_insert | VUB_insert | VUS_insert | VUL_insert | VUI_insert |
|
| Function | Insert an element into a vector |
|
| Syntax C/C++ | #include <VFstd.h>
void VF_insert( fVector X, ui size, ui pos, float C ); |
| C++ VecObj | #include <OptiVec.h>
void vector<T>::insert( ui pos, const T& C ); |
| Pascal/Delphi | uses VFstd;
procedure VF_insert( X:fVector; size, pos:UInt; C:Single ); |
|
| Description | This is one of the few functions where the input vector is changed itself (instead of being mapped onto an output vector). A new element is inserted at the position pos and has the value C. Elements before pos are unchanged, elements from pos on are shifted one position higher; the last element is lost. (If you wish to save the last element, choose size big enough to have a dummy element at the end of the vector; now it will be the dummy that gets lost.) |
|
|
|
|