Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++ - Another simple' printf ' problem
I'm slowly getting into C using DM IDDE, but I'm having a problem with the following program. I'm using the IDDE on a XP machine. #include <stdio.h> int main(void) { int x; printf("Input value is: "); scanf("%d",&x); printf("\nvalue is %d ",x); getchar(); return 0; } Why does the output window disappear after I input the number 'x'. The last printf command is not written to the screen. This only happens after a scanf comand. Sep 08 2002
In article <algifn$31bk$1 digitaldaemon.com>, john russell (joru ukonline.co.uk) says...I'm slowly getting into C using DM IDDE, but I'm having a problem with the following program. I'm using the IDDE on a XP machine. #include <stdio.h> int main(void) { int x; printf("Input value is: "); scanf("%d",&x); printf("\nvalue is %d ",x); getchar(); return 0; } Why does the output window disappear after I input the number 'x'. The last printf command is not written to the screen. This only happens after a scanf comand. Sep 08 2002
Thanks. Have solved problem using _flushall as shown below #include <stdio.h> int main(void) { int x,empty; x=100; printf("Input value is: "); scanf("%d",&x); printf("\nvalue is %d ",x); empty=_flushall(); getchar(); return 0; } Thanks again for your help. "Larry Brasfield" <larry_brasfield snotmail.com> wrote in message news:MPG.17e583936b6b94ba989692 news.digitalmars.com...In article <algifn$31bk$1 digitaldaemon.com>, john russell (joru ukonline.co.uk) says...I'm slowly getting into C using DM IDDE, but I'm having a problem with Sep 10 2002
"john russell" <joru ukonline.co.uk> wrote in message news:algifn$31bk$1 digitaldaemon.com...I'm slowly getting into C using DM IDDE, but I'm having a problem with the following program. I'm using the IDDE on a XP machine. #include <stdio.h> int main(void) { int x; printf("Input value is: "); scanf("%d",&x); printf("\nvalue is %d ",x); getchar(); return 0; } Why does the output window disappear after I input the number 'x'. The Sep 08 2002
|