Thread: [Dev-C++] problem of running the code
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Theodore K. <kyp...@ya...> - 2003-12-01 11:23:48
|
Hello everyone, I am facing the following problem. I have a code. When I am compiling (ctrl + F9) the code I get no errors. When I am running it (ctrl + F10) , the dos-window disappears. (I have -system("pause") before return 0;) . When I am debugging the code (F8), then everything is OK and I get the results ( I store the results to a file). Any ideas why this is happening.? Hope, I described the problem clearly. Thanks in advace, THeo. ps. WinXP Home Edit. user Theodore Kypraios, PhD Student Department of Mathematics and Statistics, Lancaster University ================================================ Web: http://www.maths.lancs.ac.uk/~kypraios email: t.k...@la... Department of Mathematics and Statistics Fylde College Lancaster University Lancaster, LA1 4YF UK Tel:+(44)(0)1524 593443 Fax:+(44)(0)1524 592681 ================================================ |
From: Ferdinando F. <s2...@st...> - 2003-12-01 12:07:42
|
On Mon, 1 Dec 2003, Theodore Kypraios wrote: > When I am running it (ctrl + F10) , the dos-window disappears. (I > have -system("pause") before return 0;) . > Can it be that system() fails? It simply finds a shell (cmd.exe) and executes in it the command you wrote: in WinXP "pause" is defined, but something can ever go wrong. Try an input, std::cin << a char if you're using C++, instead of using system, that's less portable (maybe that not all shells support that command). You say in debug it works: how? Simply starting debug with no breakpoints it stops for you to press a key? If so try redirecting output to a file to see what normal execution printed out, this can give you more hints. Hope I helped, bye. Ferdinando |
From: Maya <Esc...@ne...> - 2003-12-01 14:32:24
|
Replace 'system("pause");' with 'std::cin.get();', and see what happens! Have a good one, but if your are going to have more than one, give me a call ;) s2...@st... wrote: >On Mon, 1 Dec 2003, Theodore Kypraios wrote: > > > >>When I am running it (ctrl + F10) , the dos-window disappears. (I >>have -system("pause") before return 0;) . >> >> >> > >Can it be that system() fails? It simply finds a shell (cmd.exe) and >executes in it the command you wrote: in WinXP "pause" is defined, but >something can ever go wrong. Try an input, std::cin << a char if you're >using C++, instead of using system, that's less portable (maybe that not >all shells support that command). > >You say in debug it works: how? Simply starting debug with no breakpoints >it stops for you to press a key? If so try redirecting output to a file to >see what normal execution printed out, this can give you more hints. > >Hope I helped, bye. > >Ferdinando > > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program. >Does SourceForge.net help you be more productive? Does it >help you create better code? SHARE THE LOVE, and help us help >YOU! Click Here: http://sourceforge.net/donate/ >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > -- Jorge Escalante FYI http://www.astro.umd.edu/~marshall/abbrev.html E-Mail Policy http://www.vif.com/users/escalante/Email_Policy.html * You cannot exercise your power to a point of humiliation. - Jean Chretien * The media's the most powerful entity on earth. They have the power to make the innocent guilty and to make the guilty innocent, and that's power. - Malcom X * "Innocent until proven guilty", no... not in Canada!! |
From: P.T. W. M. <pt...@ea...> - 2003-12-01 12:52:12
|
I use this code: include <stdio.h> int main(void) { // Do something useful here. int c; c = getchar(); return 0; } At 03:24 01-12-03, Theodore Kypraios wrote: >Hello everyone, > >I am facing the following problem. > >I have a code. When I am compiling (ctrl + F9) the code I get no errors. > >When I am running it (ctrl + F10) , the dos-window disappears. (I >have -system("pause") before return 0;) . > >When I am debugging the code (F8), then everything is OK and I get the >results ( I store the results to a file). > >Any ideas why this is happening.? Hope, I described the problem clearly. > >Thanks in advace, > >THeo. > >ps. WinXP Home Edit. user > >Theodore Kypraios, PhD Student >Department of Mathematics and Statistics, Lancaster University >================================================ >Web: http://www.maths.lancs.ac.uk/~kypraios >email: t.k...@la... > >Department of Mathematics and Statistics >Fylde College >Lancaster University >Lancaster, LA1 4YF >UK >Tel:+(44)(0)1524 593443 >Fax:+(44)(0)1524 592681 >================================================ > > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program. >Does SourceForge.net help you be more productive? Does it >help you create better code? SHARE THE LOVE, and help us help >YOU! Click Here: http://sourceforge.net/donate/ >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |