Hi all,
I needed to know the members count between two of an array. I thought on substract their addresses and divide by their lenght in order to avoid an index management.

Code:
int count = ( (unsigned long)nodeEndPtr - (unsigned long)nodeStartPtr ) / sizeof(NODE**);



As far as I test it, it works but is it feasible/secure?
Salud!

Last edited by txesmi; 03/13/15 09:39.