data_structures
Functions
array_indexof.c File Reference
#include "array.h"
+ Include dependency graph for array_indexof.c:

Go to the source code of this file.

Functions

ssize_t array_indexof (const t_array *array, const void *val)
 Returns the index at which the specified value is found in the array, or -1 if the value isn't the array. More...
 

Function Documentation

◆ array_indexof()

ssize_t array_indexof ( const t_array array,
const void *  val 
)

Returns the index at which the specified value is found in the array, or -1 if the value isn't the array.

Parameters
valThe value
Returns
the index at which the specified value is found in the array, or -1 if the value isn't the array.
Note
For this function to work, the datatype in this array must be comparable (i.e. implement the cmp function).

Definition at line 16 of file array_indexof.c.