To do inverse lookup you need to traverse the array

const int arysz = 6;

int ary[arysz] = {4, 32, 6, 2, -1, 5}

int wantedval = -1;

int wantedpos;

for (int i=0; i<arysz; i++) {

if (wantedval = ary[i]) {

wantedpos = i;

break;

}

}

If they're in order, you can also do a binary search (google it)

For finding array length, the best method is to use the above method and store a separate variable for the length. However, this works, too

int ary[12];

int len = sizeof(ary)/sizeof(ary[0])