Menu

when i compile something...(newbie)

2002-09-17
2012-09-26
  • Nobody/Anonymous

    when i compile something and run it, after the program runs, it closes the window imediately???

    how do i stop this?

     
    • Nobody/Anonymous

      Add:   #include <stdlib.h>
      Then add just before return:  system("PAUSE");
       

        Larry

       
    • Nobody/Anonymous

      Here a simple example:

      #include <iostream>
      #include <stdlib.h >

      using namespace std;

      int id = 0;

          int main()
           {
           cout << " enter: " ,cin >> id;
           cout << id << endl;
         
            system("PAUSE");
            return 0;
           }

        Larry

       
    • Nobody/Anonymous

      THANKS A LOT

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.