+ Reply to Thread
Results 1 to 2 of 2

Thread: c++ error

  1. #1
    Super Moderator rttnpig] is on a distinguished road rttnpig]'s Avatar
    Join Date
    Jun 2007
    Posts
    3,515
    Blog Entries
    3
    Thanks
    27
    Thanked 40 Times in 31 Posts

    Default c++ error

    Code:
    // Listing 4.3 - demonstrates use of
    // prefix and postfix increment and
    // decrement operators
    #include <iostream.h>
    int main()
    {
        int myAge = 39;      // initialize two integers
        int yourAge = 39;
        cout << "I am: " << myAge << " years old.\n";
        cout << "You are: " << yourAge << " years old\n";
        myAge++;         // postfix increment
        ++yourAge;       // prefix increment
        cout << "One year passes...\n";
        cout << "I am: " << myAge << " years old.\n";
        cout << "You are: " << yourAge << " years old\n";
        cout << "Another year passes\n";
        cout << "I am: " << myAge++ << " years old.\n";
        cout << "You are: " << ++yourAge << " years old\n";
        cout << "Let's print it again.\n";
        cout << "I am: " << myAge << " years old.\n";
        cout << "You are: " << yourAge << " years old\n";
          return 0;
    }
    
    quite easy thing, but wen i compile and execute it it apears msdos and disapears without me letin see the program. like if its a popup, disapeares wen i press tje ocpm-

    is there a way of pausing it so i can see it?

    thanks

  2. #2
    Coder siLenCer is on a distinguished road siLenCer's Avatar
    Join Date
    May 2007
    Posts
    446
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: c++ error

    system("PAUSE"); before you return...

+ Reply to Thread

Similar Threads

  1. please HELP! ERROR! :(
    By raki in forum Call of Duty 2
    Replies: 6
    Last Post: July 12th, 2009, 22:59
  2. [HELP]Error..
    By BraveBeast in forum Basics
    Replies: 10
    Last Post: February 25th, 2008, 22:10
  3. [ERROR] Enemy Territory error
    By lilandonaki in forum Enemy Territory
    Replies: 3
    Last Post: November 8th, 2007, 10:49
  4. ET error- recently new error that i have encountered
    By JohnnyD in forum Enemy Territory
    Replies: 10
    Last Post: July 10th, 2007, 02:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts