VectorInt::Find Method

Overload List

#SignatureDescription
1int Find(const int X) const;Finds a match for X in object values.
2int Find(const int X, const int Index, const int Len = MtxVecEOA) const;

Overload 1: int Find(const int X) const;

Finds a match for X in object values.

#NameTypeDescription
1Xconst int

Returns: the index of first matched element. If no matching elements are found, the result is -1.

Remarks:

Compare real value X with all calling object elements.

Examples
#include "MtxVecInt.h"
#include "Units.MtxVecInt.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVecInt;

void Example()
{
    TVecInt* a;
    CreateIt(a);
    a->SetIt(DewArray<int>{2,5,1,6});
    int ind = a->Find(1);  // returns 2 (the arrays are zero based)
    FreeIt(a);
}
Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler

Overload 2: int Find(const int X, const int Index, const int Len = MtxVecEOA) const;

#NameTypeDescription
1Xconst int
2Indexconst int
3Len = MtxVecEOAconst int
Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler