prg_vector_remove()

Abstract

Removes an element from the specified position in a vector, and shifts elements to fill in the empty space.

Syntax

prg_vector_remove (vector_ptr, pos_index)
Argument Type Description
vector_ptr PrgT_Vector * the vector of interest
pos_index unsigned long the position of the element to be removed

Return Type

void *

The address of the element that is removed

prg_vector.h

Details

The specified position must be within the bounds of the vector (i.e., it must be greater than or equal to 0 and less than the number of elements in the vector). Otherwise a NIL pointer is returned, and an error may be generated (depending on whether the application has enabled diagnostic error reporting). Given that the position is valid, the elements in higher positions than the removed element are shifted “down” to fill in the created space. Potentially, if the vector has been sufficiently reduced, certain memory resources may be released. The address of the element in the specified position is returned.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com