Please help.

This is a discussion on Please help. within the C++ Programming forums, part of the General Programming Boards category; Hey all. I'm new to C++, and programing in general. I know my basic HTML, but I'm still new to ...

  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
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211

  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,475
    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.
    I'm just trying to be a better person - My Name Is Earl

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21