How can I see the output of my C programs using Dev-C ++?

I am looking to follow along with the C programming language (second add-on) on a Vista machine.

So far, I have found that Dev-C ++ is the easiest IDE for this. However, I still have one problem. Whenever I run my compiled code, for example: a simple hello world program, it starts, but the console window just flickers on the screen, and I do not see the output.

How can I see the output of my C programs using Dev-C ++? I found a special solution in C ++, System("pause")and a really ugly C solution, whilelooping fflush(stdout), but nothing nice and beautiful.

+5
source share
13 answers

Windows, , . (, , ), , , .

, ; IDE , , . , Dev-++ .

, Dev-++ , Dev-++ Sourceforge. "Read First", . .

, Dev-++ . . Dev-++ V++ 2005 Express, , 10 , 2005 . , .

+5

getchar() " ". getchar, getch getc

+6

#include conio.h

getch(); return 0;

+4

, IDE. (- > → Cmd.exe → ), cd , , . , , , .

, , , , .

+2

Dev-++ , : -

#include <stdlib.h>

, , , }

system("PAUSE");

" , ..."

+2

#include : getch();

+2

( → → cmd, cd ) getchar() , , Enter. Windows system("pause"), " enter ..." ( - ).

+1

getchar(); system("pause"); return 0; . .

+1

; ...

#include <iostream>
using namespace std;
int main ()
{
   int x,y; // (Or whatever variable you want you can)

;

   cout << result 

( ); getchar .

   getchar();
}

.cpp ctrl + f 9 , ctrl + f 10 . . "Enter", .

+1

,

Ctrl + h, "" .

+1

, system("pause"); Windows.

0

system("PAUSE") , #include<stdlib.h>.

0

, c , , , stdlib.h "system (" PAUSE "); , , . . c 5 6, .. 30, .

#include <stdio.h>
#include <stdlib.h>
int main()
 {
      int a,b,c;
      a=5;b=6;
      c=a*b;
      printf("%d",c);
      system("PAUSE");
      return 0;
 }

, .

-1

All Articles