Thread: Output to console window...

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    124

    Output to console window...

    hi...
    whenever i build my project using Borland C++, the console window pops up and i see my cout commands working fine but then as soon as the program execution is over the console window dissappears...

    is this some setting issue...because i would actually like to read what's output on the console...it just opens and goes so fast...

    what am i doing wrong?

    Regards,

    Farooq

    btw if you're wondering same thing happens even if i write a program to output "Hello World!" to the console window...

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >what am i doing wrong?
    Not searching before you start a new thread. Tell me, does this have the same problem?
    Code:
    #include <iostream>
    
    int main()
    {
      std::cout<<"Hello, world!"<<std::endl;
    
      std::cin.get(); // Pause until enter is typed
    
      return 0;
    }
    My best code is written with the delete key.

  3. #3
    Banned
    Join Date
    Oct 2004
    Posts
    250
    putting
    Code:
     system("pause");
    or
    Code:
     cin.get();
    before return 0; should fix your problem

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  2. Problem with creating new window, from another window
    By Garfield in forum Windows Programming
    Replies: 6
    Last Post: 01-11-2004, 02:10 PM
  3. Linux console window questions
    By GaPe in forum Linux Programming
    Replies: 1
    Last Post: 12-28-2002, 12:18 PM
  4. Picking up characters in console window
    By GaPe in forum C Programming
    Replies: 1
    Last Post: 11-03-2002, 06:21 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM