3
I have a array
of 10 positions which is filled through a function,
ARMultiEachMarkerInfoT marcadoresVisiveis[10];
always before adding elements to the array
, the function clears all elements and fills again. I want to know how best to count how many elements the array
has, tried something like: count how many non-null elements the array has and increments a counter but was unsuccessful.
Follows 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...
}
I share the doubts about clearing the array, but for now, it’s enough. Simple solution, sometimes escapes the eyes and we try to look for something more complex or simply do not know how to look, thanks, it worked exactly as expected.
– Mathiasfc