Subj : Newb App issue... To : borland.public.cpp.borlandcpp From : abhillz@mail.com (Adam BH) Date : Fri Aug 08 2003 04:19 pm Summary: I understand code but something beyond me is causing my apps to close on finish and upon a cin line/enter. No compile warning/errors I know the apps are closing cuz they finish but I don't want them to, code at bottom. General info: OS WinXP, Compiler: bcc32.exe (same problem with dev-c++), and I'm fairly newb (day 4 of c++ in 21 days) and have a good basic grasp on most topics (I also read the online Who's Afraid of C++ and alot of other tuts). I have Accelerated C++ being delivered right now and am serious about learning, so don't tell me to buy a book I already have. I'm 17 and start programming college the 25th and am trying to get a head start so I can be designing (simple) games b4 I finish college. But I'm straight up stuck with this cin problem. I'll try to articulate the problem better than I did in the topic and in my comment. With out a cin.get "press enter to continue" at the end of the exercise applications in c++ in 21 days they all open and close immediately because the app finishes. So I got to the input applications on day 2 and ran into an odd problem. With or without my cin.get Enter trick before the end of the source whenever I hit enter to input information (in the example 2 numbers, but it does it for every cin example!) the app closes. The moderated c++ board thought this was off topic for some reason screw them though =p heh jk I don't know them or care; I just want a real answer. Do I have to add a string to make the dos window sit open until I close it or is this a deeper routed problem? Example: #include int Add (int x, int y) { cout << "In Add(), received " << x << " and " << y << "\n"; return (x+y); } int main() { cout << "I'm in main()!\n"; int a, b, c; cout << "Enter two numbers: "; cin >> a; cin >> b; cout << "\nCalling Add()\n"; c=Add(a,b); cout << "\nBack in main().\n"; cout << "c was set to " << c; cout << "\nExiting...\n\n"; /*cout << "Press ENTER to continue..." << endl; cin.get(); I had to add this to my previous non-cin projects to prevent them from closing right away - but this one closes after I enter my numbers with or without it...I'm basicly big time newb*/ return 0; } .