O, thats all it was. Ok, the [] just needed to be removed. Got it. Ill post the code in a sec. Beautiful. Thanks Dave
final code:
Code:
#include <stdio.h>
#include <stdlib.h>
#define TRUE 1
#define FALSE 0
#define N 10
int search (int a [], int n, int key){
int b;
for(b=0; b<n; b++){
if (key==*(a+b)){
return TRUE;}
/*search for values with pointer*/
}
return FALSE;
}
int main()
{
int k, j=9;
int array[]={10, 20, 13, 32, 50, 25, 40, 49, 11, 12};
k=10;
if (search(array,j,k)==TRUE){
printf ("%d does exist\n", k);}
else if(search(array,j,k)==FALSE){
printf ("%d does not exist\n", k);}
k=145;
if (search(array,j,k)==TRUE){
printf ("%d does exist\n", k);}
else if(search(array,j,k)==FALSE){
printf ("%d does not exist\n", k);}
k=15;
if (search(array,j,k)==TRUE){
printf ("%d does exist\n", k);}
else if(search(array,j,k)==FALSE){
printf ("%d does not exist\n", k);}
k=11;
if (search(array,j,k)==TRUE){
printf ("%d does exist\n", k);}
else if(search(array,j,k)==FALSE){
printf ("%d does not exist\n", k);} /*run function with values*/
system("PAUSE");
}