Question: Write a program that allows the user to search through a list of names stored in a file for a particular one. (Make sure to



Write a program that allows the user to search through a list of names stored in a file for a particular one. (Make sure to allow the user to tell you the name of their file and to check for file open errors.) The names in the file will be stored one per line (spaces are allowed in the names). You won't know the length of the list of names ahead of time. Although this might seem like the perfect place to use strcmp, most people think of searches as case insensitive - and strcmp is case sensitive. You'll have to write your own version of strcmp which is case insensitive to use in the program. (Maybe strcmp_ncase?) You can choose the actual names to use for your data. Make sure to do enough sets of data to well test your program! (Empty data set, find first item, find last item, find a few in the middle, etc.) Remember that your program cannot know how many data names are in the file ahead of time! Don't forget to read the file's name from the user and protect your program against any errors that may occur during the opening of the file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
