prg_vector_find()

Abstract

Locates an element in a vector based on the element's address, and returns the element’s position.

Syntax

prg_vector_find (vector_ptr, element_ptr, found_ptr)
Argument Type Description
vector_ptr PrgT_Vector * vector of interest
element_ptr void * address of element to be located
found_ptr int * result of the find operation: PRGC_TRUE if the search succeeded, PRGC_FALSE otherwise.

Return Type

unsigned long

zero-indexed position of the element within the vector. This return value is meaningful only if the value of &found_ptr is TRUE.

prg_vector.h

Details

Searches through the elements of the vector (note the performance implications of calling this function). If an element with the specified address is found, its position index in the vector is returned. This function allows the vector to be “contents-addressable”.

The return value is zero-indexed. If this procedure does not find the element, it returns a meaningless value; for this reason, you should always check the value of &found_ptr before using the return value.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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