Thread: Please help.

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    1

    Please help.

    Hey all.
    I'm new to C++, and programing in general. I know my basic HTML, but I'm still new to most programing.

    I have done some very basic tuts and so far they have worked. But I have a problem. I save the file before I compile the code, and after I compile it and try to open the file the window pops up and closes before I even have a chance to see it. The only way I can see the results are to open Dos command propt and use the select and drag meathod into the dos window. I can see the results but I would still like to just double click the file and it open.

    I'm using Dev C++. I can try and go into more detail if needed. Please any help would be awesome.
    Thanks!

  2. #2

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    15
    typing
    cin.get() ;
    at the end of your program
    is a good solution

  4. #4
    Registered User
    Join Date
    Dec 2007
    Posts
    1
    on a similar note
    cin.ignore();



    wow i just noticed the date on this thing....its ancient

  5. #5
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    If you are reading input with cin >> then on Dev-C++ you will need cin.ignore as discribed above, if not then standard cim.get() will do the trick. Place it before return 0 in your main funcion. Other IDE's ( like MSVC++ ) do this for you. Just stay away from system("pause") as its a hard habbit to break out of.
    Double Helix STL

Popular pages Recent additions subscribe to a feed