# classname_fieldname_erase(vector)

> This function removes an element of a vector from the layout and all indexes the element is included into.

### Prototype

>         MCO_RET	classname_fieldname_erase(	/*IN*/ classname *handle,
>                                /*IN*/ uint2 index );

### Arguments

handle | A pointer to a classname handle
index | A `uint2` that specifies the offset from the start of the vector of the vector element to erase

### Description

> The erase method removes an element of a vector from the layout and all indexes the element is included into. Note that the vector size remains unchanged. If an attempt is made to get the erased element, the runtime returns a null pointer as a result. Also note that the erase method is only generated for vectors of structures and strings, not for vectors of basic types. Like ‘C’ arrays, vectors are counted from zero.

### Return Codes

MCO_S_OK | The vector element was erased successfully
MCO_E_INDEXLIMIT | Index is out of range

Related Topics