![]() |
|
#1
|
|||
|
|||
Need assistance with programI've got a program written that seems to be set up fine. I can compile without any warnings or errors, but I get zero output. Nothing back from the system at all. It runs and then kills itself. If I had an error to work with, I might be able to figure it out, or at least some kind of output, but this is crazy.
It's for a term project that, unfortunately, is due tomorrow. I've been spending the time tweaking the program, getting it to run with reasonable success, but now it won't do anything. Here is the assignment question: Quote:
Below is what I've written. CPP / C++ / C Code:
What am I missing here? |
|
#2
|
|||
|
|||
|
Quote:
The very first thing you should (always) do is to make sure the program is working on what you think it is. That is, print out the values of all user input variables. As I look at the beginning of your program, I see errors in scanf. scanf takes addresses. So you could try this, for starters: CPP / C++ / C Code:
Now, as program execution progresses, put printf at strategic points to make sure function arguments are being passed correctly, formulas are working on appropriate values, etc. Regards, Dave |
|
#3
|
|||
|
|||
|
I appreciate the idea, but the program doesn't even ask for input. I run it from the command line, and it just returns me back to the command line. The program doesn't even execute far enough to get any values from the user, so it's even earlier than that.
As far as the addresses go, I just entered that in for the heck of it, to see if I would get any errors or not, and again, nothing. No compilation errors, no running errors. I get zero output. Thanks for looking at it, at the least. |
|
#4
|
|||
|
|||
|
Quote:
If you compiled and linked that program with no errors and it didn't run, then there is something seriously wrong with your setup. There's nothing anyone somewhere else can do to help you. Maybe you can just comment out the rest of the program after the input lines and see if it does anything: CPP / C++ / C Code:
If this compiles and links and executes OK, then add other parts and see what happens. Good luck! Regards, Dave |
Recent GIDBlog
Meeting the local Iraqis by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 07:44 |
| [TUTORIAL] Calling an external program in C (Linux) | dsmith | C Programming Language | 4 | 22-Apr-2005 13:30 |
| fltk-2.0 cvs | Plumb | FLTK Forum | 20 | 13-Nov-2004 07:10 |
| Need help with a C program (Long) | McFury | C Programming Language | 3 | 29-Apr-2004 20:06 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The