The function called skipped over when i run the program. What's the problem?
#include <iostream>
using namespace std;
void searchId(int id[], int& idNum);
int main()
{
int idNum;
int count;
int *id;
int Numid;
cout << "Please input the number of id numbers to be read "<<endl; //
cin >> idNum;
id = new int[idNum]; //To allocate the float variable sales here
for (count = 0; count < idNum; count++)
{
cout << "Please enter an id number " << endl;
cin >> id[count];
id[count]=Numid;
}
cout << "Please input an id number to be searched " << endl;
cin >> nid;
searchId(Numid,idNum);//Calling function
delete id;
system("pause");
return 0;
}
void searchId(int Numid,int idNum)
{
int count;
int nid;
for (count = 0; count < idNum; count++)
{
if(nid == Numid)
cout << nid <<"is in the array "<< endl;
else
cout << nid <<"is not in the array "<< endl;
}
}