C4 Engine Terathon Software C4 Engine API Documentation

• Utility Library

API Links
Developer Links

Array::FindElement

Defined in:  C4Array.h
Finds a specific element in an array.
Prototype

int32 FindElement(const type& element) const;

Parameters
element The value of the element to find.
Description
The FindElement function searches an array for the first element matching the value passed into the element parameter based on the == operator. If a match is found, its index is returned. If no match is found, then the return value is −1. The running time of this function is O(n), where n is the number of elements in the array.