whenever I call this function it fails to give the use a chance to enter the string. Not sure why pretty sure my syntax is spot on. think I has something to do with the newline but I don't know how to get rid of it
void serchName(dealers_t *ptr, int numDealers) { char dealerName[NAME_LEN]; int index; printf("please enter the dealer's name:"); fgets(dealerName, sizeof(dealerName), stdin); system("PAUSE"); for (index = 0; index < numDealers; index++, ptr++) { if (strcmp(dealerName, ptr->name) == 0) { printf("MATCH FOUND:%s\n%s\n%s\n%i\n%s\n", ptr->name,ptr->city,ptr->state,ptr->zip,ptr->phone); } } }