/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>

int intlen(int *a)
{
   int n = 0;
   while(*a != -1)
   {
      n++;
      a++;
   }
   return n;
}

int main()
{
   int a1[] = { 1,2,3,-1 };
   int a2[] = { 1,2,3,4,5,-1 };
   printf("%d\n",intlen(a1));
   printf("%d\n",intlen(a2));
   return 0;
}
