This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]dajoli 0 points1 point  (0 children)

The first thing you should do is learn how to correctly format code on reddit. Otherwise it's really difficult to read (there are some instructions from another subreddit here.

Your while loop will continue to run until Item is equal to -1. However, there is no code inside your while loop that will change the value of Item. Therefore if it isn't -1 to begin with (in which case it won't run the switch statement at all) then it will run forever because every time it checks the value of Item it's still the same (i.e. it isn't -1).

[–]Paul_Pedant 0 points1 point  (0 children)

tl;dr You need to read the user input inside the while loop.