I have a funny feeling this is a stupid question so bear with me. I'm passing a string array to a function to search for elements in it. I have what is written below, and all it does is print "Not Found" five times. I'd also like it to print out each occurrence of the target. I've been playing with it for too long and am getting nowhere. I've echo printed all of the variables to be sure they're being read but somethings still not right. I'd appreciate any help. Thanks.
void searchString(string A[],int size, string target)
{
int j;
{
for(j=0; j < size; j++)
if(A[j] == target)
cout << A[j] << endl;
else cout << "Not Found";
}
}