Since your array contains 'holes', the only viable approach is to pass its size, e.g.
#include <stdio.h>
#include "string.h"
const char *const fruit[]=
{
[1] ="apple1",
[5]= "apple2",
[3] ="apple3",
[4] ="apple4"
};
void show(const char *const item[], size_t items)
{
for ( size_t n = 0; n < items; ++n)
printf("item[%lu] = %s\n", n, item[n]);
}
int main()
{
show( fruit, sizeof(fruit)/sizeof(fruit[0]) );
}
With a more 'regular' array (that is without holes), the 'sentinel' approach is an alternative
#include <stdio.h>
#include "string.h"
const char *const fruit[]=
{
"apple1",
"apple2",
"apple3",
"apple4",
NULL };
void show(const char *const item[])
{
for ( size_t n = 0; item[n]; ++n)
printf("item[%lu] = %s\n", n, item[n]);
}
int main()
{
show( fruit );
}