Question:

Dev C++ output help?

by  |  earlier

0 LIKES UnLike

when i run a program i have made in Dev C++, i compile and run it but the output on the command line flashes for about a quarter of a second and then goes away, i can never see it. Is there any way i can make it stay open and not instantly go? i am only a C++ novice,

So any help is appreciated, thank you.

 Tags:

   Report

2 ANSWERS


  1. You need the C++ equivalent of the C command system("PAUSE"); which causes the program to wait until a key is pressed. Dev C++ may allow the use of the C command, even if the rest of your code is C++.


  2. use the header file

    #include<conio.h>

    and use the function

    getch();

    this makes the output screen to stay till u press a key

    eg:

    #include<iostream.h>

    #include<conio.h>

    int main()

    {

    cout<<"HI";

    getch();

    return(0);

    }
You're reading: Dev C++ output help?

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.