Sorry I am new to C programming & this newsgroup. But I downloaded a C
compiler & when it runs the executable file it pops up the dos prompt & shows
my executed file but only for a nanosecond & then flips off. I cant see my
executed file. I can go to the MSDOS prompt & run it but thats a pain.
There's got to be some place to click where you can look at it until you press
a key or something. HElp 12 1890
MatthewMlane <ma**********@aol.com> scribbled the following: Sorry I am new to C programming & this newsgroup. But I downloaded a C compiler & when it runs the executable file it pops up the dos prompt & shows my executed file but only for a nanosecond & then flips off. I cant see my executed file. I can go to the MSDOS prompt & run it but thats a pain. There's got to be some place to click where you can look at it until you press a key or something. HElp
Your compiler's options configuration couldn't really have much less to
do with the C language. If you want further help on that, please ask in
a Microsoft newsgroup, or consult the Bloodshed Dev. Compiler customer
support directly.
However there is an easy work-around, which is a reasonably portable ISO
C solution. Simply insert a call to getchar() as the final statement of
your program, and your program will sit around waiting for a character
to appear in stdin, which usually means that it will wait until you
press Return.
--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"I said 'play as you've never played before', not 'play as IF you've never
played before'!"
- Andy Capp
MatthewMlane wrote on 03/09/04 : Sorry I am new to C programming & this newsgroup. But I downloaded a C compiler & when it runs the executable file it pops up the dos prompt & shows my executed file but only for a nanosecond & then flips off. I cant see my executed file. I can go to the MSDOS prompt & run it but thats a pain. There's got to be some place to click where you can look at it until you press a key or something. HElp
Use the code generator. The minimum example has a
#include <stdlib.h>
<...>
system ("pause");
at the end of main() call that makes the trick.
If you have several exit() calls in your code, let main() ends with
return 0;
but add the following in the beginning of main() :
#include <stdlib.h>
<...>
atexit (on_exit);
with
static void on_exit (void)
{
system ("pause");
}
placed before.
--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html
"C is a sharp tool"
MatthewMlane wrote: Sorry I am new to C programming & this newsgroup. But I downloaded a C compiler & when it runs the executable file it pops up the dos prompt & shows my executed file but only for a nanosecond & then flips off. I cant see my executed file. I can go to the MSDOS prompt & run it but thats a pain. There's got to be some place to click where you can look at it until you press a key or something. HElp
This is off-topic for c.l.c, but in essence you are using an IDE,
not a compiler. The IDE runs the compiler. You should get used
to using the command line - just leave the so-called dos window
open at all times, and you can get back and forth with an ALT-tab
(under windoze). Then you can learn to use it for the actual
compilation later.
For further info try the learn-c-c++ group (or something like
that) or a group that deals with your actual system.
--
"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
MatthewMlane wrote: Sorry I am new to C programming & this newsgroup. But I downloaded a C compiler & when it runs the executable file it pops up the dos prompt & shows my executed file but only for a nanosecond & then flips off. I cant see my executed file. I can go to the MSDOS prompt & run it but thats a pain. There's got to be some place to click where you can look at it until you press a key or something. HElp
Try this program:
#include <stdio.h>
int main (void)
{ puts ("Press the <enter> key to exit.");
getchar ();
return 0;
}
Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo no****@mega-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
"There is no satisfactory substitute for excellence."
-- Dr. Arnold O. Beckman
Erik de Castro Lopo <no****@mega-nerd.com> wrote in message news:<41**************@mega-nerd.com>... MatthewMlane wrote: Sorry I am new to C programming & this newsgroup. But I downloaded a C compiler & when it runs the executable file it pops up the dos prompt & shows my executed file but only for a nanosecond & then flips off. I cant see my executed file. I can go to the MSDOS prompt & run it but thats a pain. There's got to be some place to click where you can look at it until you press a key or something. HElp
Try this program:
#include <stdio.h> int main (void) { puts ("Press the <enter> key to exit."); getchar (); return 0; }
Erik
at least you replied eric. I understand this is a c.l.c but that's a
pretty n00bie question and it takes 1 line of code to show the guy
what to do. You guys need to chill a bit and stop being so esoteric
and snotty. *only words i could think of *
Thanks for your help guys. You helped out the ultimate noobie. I've tried the
GetCHar & the Pause & they both work fine.
Also another off topic maybe question? Is it worth the extra money to buy the
Microsoft C++ compiler? I might be able to get it for a discount.
MatthewMlane wrote:
.... snip ... Also another off topic maybe question? Is it worth the extra money to buy the Microsoft C++ compiler? I might be able to get it for a discount.
Probably not. Microsoft has announced that they will never make
it C99 compliant, they don't fix bugs, and you should eschew all
Microsoft software on principal. Whatever you get out of it will
only work on Microsoft OSs (and probably not even there after a
few years), while better systems can supply you cross-compilers
and whatnot.
Unless you have an absolute requirement for it, no.
--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
CBFalconer wrote: MatthewMlane wrote:
... snip ...
Also another off topic maybe question? Is it worth the extra money to buy the Microsoft C++ compiler? I might be able to get it for a discount.
Probably not. Microsoft has announced that they will never make it C99 compliant,
Could you point me to an URL with an official statement to that effect?
they don't fix bugs, and you should eschew all Microsoft software on principal. Whatever you get out of it will only work on Microsoft OSs (and probably not even there after a few years), while better systems can supply you cross-compilers and whatnot.
Unless you have an absolute requirement for it, no.
--
Michel Bardiaux
Peaktime Belgium S.A. Bd. du Souverain, 191 B-1160 Bruxelles
Tel : +32 2 790.29.41 ma**********@aol.com (MatthewMlane) wrote: Also another off topic maybe question? Is it worth the extra money to buy the Microsoft C++ compiler? I might be able to get it for a discount.
I've only been using Dev-C for a short while, but I'm quite satisfied. I
gather M$C comes with more bells and whistles (for example, with an icon
editor, which I had to write myself to do chapter 10 in Petzold's
Programming in Windows), but if you can do without those or have them
from somewhere else, I see no reason to use M$C.
Unless, of course, you need to be object-compatible with its output.
Then you're effectively locked in. But for most applications, I'd say
stick with Dev-C.
Richard
On Mon, 06 Sep 2004 15:06:41 +0200, Michel Bardiaux
<mi*************@peaktime.be> wrote: CBFalconer wrote:
MatthewMlane wrote:
... snip ...
Also another off topic maybe question? Is it worth the extra money to buy the Microsoft C++ compiler? I might be able to get it for a discount.
Probably not. Microsoft has announced that they will never make it C99 compliant,
Could you point me to an URL with an official statement to that effect?
I doubt that you'll ever find such an "official statement", but Stan
Lippman (MS Architect for Visual C++) said in an interview that
Microsoft will not simply implement features because they are
specified in the standard. http://www.thecodeproject.com/interv...n14nov2001.asp they don't fix bugs, and you should eschew all Microsoft software on principal. Whatever you get out of it will only work on Microsoft OSs (and probably not even there after a few years), while better systems can supply you cross-compilers and whatnot.
Unless you have an absolute requirement for it, no.
--
Al Balmer
Balmer Consulting re************************@att.net
Alan Balmer <al******@att.net> scribbled the following: On Mon, 06 Sep 2004 15:06:41 +0200, Michel Bardiaux <mi*************@peaktime.be> wrote:CBFalconer wrote: Probably not. Microsoft has announced that they will never make it C99 compliant, Could you point me to an URL with an official statement to that effect?
I doubt that you'll ever find such an "official statement", but Stan Lippman (MS Architect for Visual C++) said in an interview that Microsoft will not simply implement features because they are specified in the standard.
http://www.thecodeproject.com/interv...n14nov2001.asp
Of course, Lippman realises that this really prevents Microsoft from
calling Visual C++ a C compiler? They can call it a "Microsoft C"
compiler where "Microsoft C" and C are different languages sharing a
considerably large intersection.
--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"All that flower power is no match for my glower power!"
- Montgomery Burns This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Developwebsites |
last post by:
I have tried out these C++ compilers:
Watcom 11.0c - simply does not work.
now they bundled fortran with c++ but it just
doesnt install on my pc.
digi-mars DOS - good, fast, small.
however, no...
|
by: PointNot |
last post by:
I'm coding in Dev C++ by bloodshed my questions are....
I want to learn to create GUI windows interfaces, can I do it in here.
I've never learned the visual aspect of C++ yet, and would like to...
|
by: bob |
last post by:
I'm using Bloodshed Dev-C++, and I'm getting ready to distribute a
program I made with it. Does anyone know how to change the icon of the
program? I'm not sure how resources work in Bloodshed,...
|
by: PCHOME |
last post by:
Hi!
I am looking for a good free IDE C Compiler.
Dose any have experience on using them?
Which is better? Bloodshed C or Miracle C?
Or anyother free IDE C Compiler you like to recomend?
...
|
by: ZaRMaS |
last post by:
Hi all,
i want to build an executable, wich take in parameter a path to another
executable. My executable add a protection like a password with a
window or an expiration time out. My executable...
|
by: pauldepstein |
last post by:
Just installed dev cpp on Windows XP. When I try to compile programs,
however simple, I always get the message Linker error undefined
reference to cpu_features_init. Could someone please help me...
|
by: The End |
last post by:
Hi when in stalling Dev-C++ on my computer (Windows Xp) i get an error on installation which does not allow me to compile i need some help to fix this problem so i can use the program.
Ok the...
|
by: Dave -Turner |
last post by:
So I just downloaded Bloodshed devcpp, opened up the Hello example, compiled
it, no problems ..... well, except one - the exe is 474,990 bytes!
What's the secret to compiling small exes?
Thanks
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |