![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | ||
|
Newbie
Join Date: Apr 2005
Posts: 3
Rep Power: 0
![]() |
Need assistance with program
I'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:
Quote:
|
||
|
|
|
|
|
#2 |
|
Programmer
Join Date: Feb 2005
Posts: 89
Rep Power: 4
![]() |
i don't have time to help you much, but let me suggest the following.
every once in a while, write a status line to a flat text file. then, execute the program. read the output file to figure out how far it got. this is a good diagnostic tool and i think it'll get you an answer in short order. just output a line number and the values of a few variables followed by a carriage return. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Apr 2005
Posts: 3
Rep Power: 0
![]() |
I tried it. I tried dumping my main function right at the beginning, and it wouldn't even do that. I think it has something to do with the function declaration at the beginning, but since they aren't called until later, I can't dump them either.
I admit, I'm not good at creating debugging scripts, but the program seems to die before it even gets going. Like it's something wrong with one of the libraries I included that won't let it execute. I have no clue, really, especially since it compiles perfectly. |
|
|
|
|
|
#4 |
|
Programming Guru
![]() |
sorry i cant help i cant even get it to compile, i think we need your custom header file to check it easier
|
|
|
|
|
|
#5 |
|
Programmer
Join Date: Feb 2005
Posts: 64
Rep Power: 4
![]() |
scanf requires the address of the variable you're reading into
&start_atoms &enter_atoms Also, you should you srand() to seed the random number generator, or you'll always get the same output. a common solution is to include ctime.h and use time(NULL) srand(time(NULL)); Last edited by spydoor; Apr 20th, 2005 at 8:54 AM. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|