
-----------------------------------
Quakerstate98
Wed Apr 09, 2008 12:36 pm

Bug using binary search need help for school
-----------------------------------
Hey guys ok this project takes in a txt file of names and numbers, puts them into 2 vectors and using recursion and iteratvice w/e binary searches the user can input a name from the file and it will return their corresponding number. I have the program working but if the user types a incorrect name it crashes I cannot figure out how to get around this.

To get to the error run the program
for txt file input type in: phonelistbyname.txt

for the program to not crash the name u can input after is AARON, ABNEY, PAUL works
to make it crash input any name lower case, hopefully someone out here knows how to fix it :S

compiling with win32

-----------------------------------
md
Wed Apr 09, 2008 3:30 pm

RE:Bug using binary search need help for school
-----------------------------------
Without looking at your code... have you looked into std::map?

I shall attempt to take a look later when I complete my final project.

-----------------------------------
A.J
Wed Apr 09, 2008 11:40 pm

Re: Bug using binary search need help for school
-----------------------------------
try converting everything to small letters and store it on another array and then binary search from there on...(make sure that u have a copy of the original input names so hat u can output them)

-----------------------------------
Quakerstate98
Wed Apr 09, 2008 11:52 pm

Re: Bug using binary search need help for school
-----------------------------------
i would convert then to lower case but that would actually cost me marks because I'm going outside of the project specifications. Prof wants us to be able to work with his file that he gives us without having to change it up. Apreciate the suggestion, any other ideas?

-----------------------------------
OneOffDriveByPoster
Thu Apr 10, 2008 12:43 am

Re: Bug using binary search need help for school
-----------------------------------
i would convert then to lower case but that would actually cost me marks because I'm going outside of the project specifications. Prof wants us to be able to work with his file that he gives us without having to change it up. Apreciate the suggestion, any other ideas?You don't have to change the file to change to lowercase within your program...

-----------------------------------
md
Thu Apr 10, 2008 10:42 am

RE:Bug using binary search need help for school
-----------------------------------
Using multiple vectors when one vector and a struct would do is poor form.
