![]() |
My programs aren't running...( no errors)
Some of the programs that I run on Dev+-C++ won't run for some reason. Does this occur often? If so, what can I do? (I don't have a code with me but I'm sure that errors isn't the reason why my program isn't running.)
If anyone can help, Thanks! |
Re: My programs aren't running...( no errors)
>> but I'm sure that errors isn't the reason why my program isn't running
Hate to be the bearer of bad news but 99.99999% of the time that is exactly the reason a program won't run. If not syntax errors then logic errors. >>If anyone can help Impossible without the source code. I don't have my crystle ball with me today or I'd ask the Gods about your code :) |
Re: My programs aren't running...( no errors)
Ok, here's a simple program that I recently wrote (and won't run):
:
|
Re: My programs aren't running...( no errors)
Bump. Thanks.
|
Re: My programs aren't running...( no errors)
Define "won't run". Do you get any reaction out of your IDE when you try to run it? Maybe something just pops up and goes away or something? Do the tool windows get changed (not familiar with Dev-C++ sorry)?
|
Re: My programs aren't running...( no errors)
You misspelled "namespace".
You're missing a semi-colon on line 6. :
#include <iostream> |
Re: My programs aren't running...( no errors)
Try putting in a
:
SYSTEM("PAUSE"); |
Re: My programs aren't running...( no errors)
That'll only work on Windows under standard circumstances - there are any number of changes to the OS or file system that could cause that to fail. And it definitely won't work on *nix - including Mac OS.
Try this: :
cout >> "Press any key to exit." >> endl; |
Re: My programs aren't running...( no errors)
To explain what's happening. The code is "running". However, the program completes and terminates. The system therefore determines that the console window (which was created specifically for the purpose of running the program) to which output has been written is no longer needed, so it destroys the console window. Net effect is that the program disappears before you can see its output.
|
Re: My programs aren't running...( no errors)
I'm trying to figure out where the confusion still lies. He posted code that clearly had some errors in it. It also had
cin statements before the console could even terminate, so that could not be the problem. I think his compiler was just giving him heck for his missing semi-colon. But perhaps that wasn't a good example of his problem. |
| All times are GMT -5. The time now is 6:07 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC