Did you bother to read up on sizeof? It returns the size of teh object in bytes. The C idiom to convert this to elements is sizeof(object)/sizeof(object[0]). In the function it just gets a pointer to your array. You need to pass the number of elements as a global or another function parameter.