Results not shown

Michael
2012-10-29
2012-11-05
  • Michael

    Michael - 2012-10-29

    Just starting off - not very well!
    I have carefully created 'Hello World', saved the result to My Docs, but when I try to see the result the command window opens, immediately closes and I can just see that it is blank.
    What am I not doing right?
    Using Win7, but the result is the same with my XP (SP3) machine.

     
    • Scott Beckstrand

      It is the nature of Windows. The program opens a command window, but as soon as the program ends, it closes the window. If you want to keep it open, open the command window manually and then execute the program from inside the command window.


      From: Michael [philoctetes@users.sf.net]
      Sent: Monday, October 29, 2012 2:55 AM
      To: [dev-cpp:discussion]
      Subject: [dev-cpp:discussion] Results not shown

      Just starting off - not very well!
      I have carefully created 'Hello World', saved the result to My Docs, but when I try to see the result the command window opens, immediately closes and I can just see that it is blank.
      What am I not doing right?
      Using Win7, but the result is the same with my XP (SP3) machine.


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/dev-cpp/discussion/48211/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/prefs/

       
    • Ramor

      Ramor - 2012-11-05

      Hi Michael, here an answer to your problem:

      include <iostream>

      using namespace std;

      int main (int argc, char *argv[])
      {
      char quit;

      quit = '\0';
      while (quit != 'q')
      {
          cout << "Hello ! This is a console app." << endl;
          cout << "To create a console, go to Project Options and select"
      

      << endl;
      cout << "\'Win32 Console\'." << endl;
      cout << "Press q to quit " << endl;
      cin >> quit;
      }

      return 0;
      

      }

      Console Programs just close after having done what they should do. So u
      need something to keep it open. Like waiting for a key to be pressed.

      I hope that helps you. Just forgot my sourceforge login or i would have
      posted there.

      Have fun

      Ramor

       
      Last edit: Ramor 2012-11-10

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks