15 lines
274 B
C
15 lines
274 B
C
#pragma once
|
|
|
|
#define NB_ELEMENTS(x) (sizeof(x)/ sizeof(x[0]))
|
|
|
|
#define STRINGIFY(x) #x
|
|
#define TOSTRING(x) STRINGIFY(x)
|
|
|
|
int findIndex(int el, const int array[]){
|
|
for ( uint i = 0; i < NB_ELEMENTS(array); i++) {
|
|
if (el == array[i])
|
|
return i;
|
|
}
|
|
return -1;
|
|
}
|