hi im having a bit of a problem with a gets function
ok ignore any small errors in here the problem i have concerns the gets functionCode:void store::findF(void) { int i = 0; bool serch = false; char person[20]; //system("cls"); cout << "please enter the name of the person you wish to find their details : " << endl; gets (person); cout << person; for(i = 0; i < Voters; i++) { if(!strcmp(np[i].name, person) ) { cout << "Eurika" << np[i].name << "\n" << np[i].phone << "\n" << np[i].address << "\n" ; cout << np[i].email << "\n" << np[i].party ; serch = true; } // cout<<i; } if(serch == false) { cout << "Sorry record not found."; } }
when i call this function the gets returns a null value and therefore prints eurikia and a list of names from my database/list
any help would be most appreciated