Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Linear search function using pointers in C

/* Linear Search Function using pointers in C */
long linear_search(long *pointer, long n, long find)
{
   long c;

   for (c = 0; c       if (*(pointer+c) == find)
         return c;
   }

   return -1;
}
Read More:
Simple Linear Search in C 
Linear search for multiple occurrences
Linear search using function in C


This post first appeared on Ask For Program, please read the originial post: here

Share the post

Linear search function using pointers in C

×

Subscribe to Ask For Program

Get updates delivered right to your inbox!

Thank you for your subscription

×