I have a array
of 10 positions that is filled by a function,
ARMultiEachMarkerInfoT marcadoresVisiveis[10];
Always before adding elements to array
, the function clears all elements and populates again. I want to know the best way to count how many elements array
has, I tried something like: count how many non-null elements the array has and increment a counter but I did not succeed.
Follow the function:
void ReposicionaObjetos(){
int i;
//Limpa o array
memset(marcadoresVisiveis, 0, sizeof marcadoresVisiveis);
//Preenche o array
for( i = 0; i < config->marker_num; i++ ) {
if( config->marker[i].visible >= 0 ){
marcadoresVisiveis[i] = config->marker[i];
}
}
//... Saber quantos elementos o array possui...
}