Hey guys, I was using a switch statement for a menu so when the user entered a number from the menu that action was taken. The last option in the menu when pressed just said thanks for using the program then it would say press any key to continue.

Although for some reason this wouldn't be displayed after another option was chosen from the menu (it would just display some information from the last menu option the user had entered) so I had to use the exit(0) function.

I was just wondering why the first method didn't work?

Thanks in advance.

Well we're not psychics. Let me just look thru the provided source and we'll see your problem.

Hi, thanks for your reply.. sorry it was very silly of me not to post the source code, although I have figured out the problem it seems to be because I was calling the menu from another function so when I selected exit from the switch statement as I hadn't used the exit() command it went back to the previous function.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.