Multiple things seem to be wrong, I'll try to make a list and edit it, if I have time to find more.
1.
1 2 3
|
isExist(ssn, records, number_of_records);
if (isExist==false)
listRecords(records, number_of_records);
|
isExist is not a declared variable. Your isExist()
function returns a bool value (Line 18 and Line 22), but you do not do anything with this value.
Instead, you'd want to something like this
1 2
|
if (!isExist(ssn, records, number_of_records))
listRecords(records, number_of_records);
|
2.
1 2 3
|
do {
...
} while (choice != 0);
|
Your
choice variable is never changed in this loop. If this is intended, you could do
while (true), otherwise you should change your choice condition to 0 at some point inside the loop.
3.
bool isExist(int ssn, int records[32], int number_of_records) {...}//Line 40
If records is an argument, it should just be
int records[] or
int * records. This also applies to line 5 and 6.
4.
1 2 3 4 5 6 7 8 9 10 11 12
|
void listRecords(int records[], int number_of_records)
{
//int *p;
int a=32, ssn=1022;
//p = &a;
number_of_records = 32;
do {records[a] = ssn;
a--;
} while (a < number_of_records);
}
|
There is currently no point to passing in number_of_records to this function, because it will always just assign 32 to number_of_records.
Also, if your records array has a length of 32,
records[32] does not exist because array indices start at 0.
Third, if "a" is initially 32, and you are decrementing it by 1 each time, a will ALWAYS be less than number of records, which is 32. You have an infinite loop.
5.
Not necessarily wrong, but
1 2
|
cin >> ssn; //Line 63
ssn = ssn;
|
The bold line doesn't do anything, you are assigning something to itself. doing cin is enough to store the variable.