I have Dev-C++ version 4.9.9.2 and Windows XP Pro SP3. I having no trouble compiling but I am having trouble getting my executable to show up. It flashes and then goes away.
printf("There are %d people, %d places to visit, and %d things to kill", people, places, things);
}
Thanks a ton for any advice. As a newb to programming somewhat, this is probably an extremely simple fix, but after some searching I couldn't find my exact problem answered. Probably pretty close though, but I figured I might as well confirm it with 1337 SOB's here. :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, I finally figured it out. I just add "getchar();". That was simple as hell. I wonder if because my C programming book is 8 years old (2001 copyright of a 1998 book called "Beginning C" by Ivor Horton) that maybe somehow leaving that out a decade ago wasn't a big deal but today it's relevant? You guys don't have to answer that, I'll do my own research, but any pithy comments are always welcome. :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The 'problem' is that the normal behaviour of Windows is to close an application's window when the application terminates. You'd hardly want it any other way, but it seems to surprise people when it happens to their own applications!
The problem is so common it is dealt with in the "PLEASE READ BEFORE POSTING A QUESTION" thread, so it is lucky that you figured it out and posted back, and probably saved yourself a flaming! ;-)
Some IDE's (VC++ for example) execute projects in a wrapper that holds the console open. It is a simple thing to do, and useful for development, but the developers of Dev-C++ have chosen not to do it for some reason.
Note that using getchar() is not always the best solution. Any unused lines in the input line-buffer will cause it to return without waiting.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have Dev-C++ version 4.9.9.2 and Windows XP Pro SP3. I having no trouble compiling but I am having trouble getting my executable to show up. It flashes and then goes away.
My Compile Log reads like so:
Compiler: Default compiler
Executing gcc.exe...
gcc.exe "C:\programming\first.c" -o "C:\programming\first.exe"
Execution terminated
Compilation successful
My program is extremely basic, like so:
include <stdio.h>
main()
{
int people, places, things;
people = 5;
places = 4;
things = 3;
printf("There are %d people, %d places to visit, and %d things to kill", people, places, things);
}
Thanks a ton for any advice. As a newb to programming somewhat, this is probably an extremely simple fix, but after some searching I couldn't find my exact problem answered. Probably pretty close though, but I figured I might as well confirm it with 1337 SOB's here. :)
Well, I finally figured it out. I just add "getchar();". That was simple as hell. I wonder if because my C programming book is 8 years old (2001 copyright of a 1998 book called "Beginning C" by Ivor Horton) that maybe somehow leaving that out a decade ago wasn't a big deal but today it's relevant? You guys don't have to answer that, I'll do my own research, but any pithy comments are always welcome. :)
The 'problem' is that the normal behaviour of Windows is to close an application's window when the application terminates. You'd hardly want it any other way, but it seems to surprise people when it happens to their own applications!
The problem is so common it is dealt with in the "PLEASE READ BEFORE POSTING A QUESTION" thread, so it is lucky that you figured it out and posted back, and probably saved yourself a flaming! ;-)
Some IDE's (VC++ for example) execute projects in a wrapper that holds the console open. It is a simple thing to do, and useful for development, but the developers of Dev-C++ have chosen not to do it for some reason.
Note that using getchar() is not always the best solution. Any unused lines in the input line-buffer will cause it to return without waiting.
Clifford