I cannot seem to find what is causing my program to fall into an infinite loop. When the user enters "2" and goes into the lookupTaxes function, they then pick an address. After that, the program "should" return to the displayMenu function and start from the top. Repeating this, so long as the user does not enter "5". But, every time I enter the street address in the lookupTaxes function, the program falls into an infinite loop. I'm not following the logic here. Suggestions?
@TheIdeasMan - I tried to follow the example you asked me to look at but I'm still running into issues. Now, when prompted to enter the selection from the menu, it keeps prompting without entering the switch....I cannot figure out what's wrong with the logic.
You have declared selection as an int , but in the cases they are quoted which means they are a char - which will have a different value.
Also, would it make sense to call displayMenu() at the beginning of the while loop, and not have it as a menu option?
Some other things:
Don't have line 5, Google as to why that is so. Instead put std:: before each std thing. It might seem a pain, but you will notice that all the expert people on this site always do it - such as JLBorges as just one example. It will save you from some hard to see bugs in the future.
Try not to have global variables of any sort. Pass them as parameters to any function which needs them. Again, this will save problems in the future.
With your addresses, having the user type them in is error prone, if they type in 120 xenia say, then the code will fail. Much better to print them all out with an associated number, and have the user type that in. When you learn how to use a struct, you can group all the like things together- address, tax etc.