I am using Dev C++ and I am trying to keep program kept open after I run it. I put cin.get(); right where I am supposed to but when I run it, it does not stay open. It worked one time, but now it is not working. Why?
I am using Dev C++ and I am trying to keep program kept open after I run it. I put cin.get(); right where I am supposed to but when I run it, it does not stay open. It worked one time, but now it is not working. Why?
Hard to tell if you don't post your code. If you have conio.h, you could use getch() instead.
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
Oh yeah i forgot about that. Getch() worked. Thanks, it was probably a dumb question.
>>It worked one time, but now it is not working. Why?
Probably due to leftover data in the input buffer. Did you >> in a number by any chance? Maybe you need to .ignore() some data to clear the buffer.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]