![]() |
|
#1
|
|||
|
|||
PLEASE HELP, Beginner Problem with different results every time!!Hey everytime i run my c++ program to implement an Improved Eulers Method numerical loop to calculate the response of something (dont worry about the maths behind it i know the equations are right!) i get different answers each time i do it. Ive tried setting each of the variables in the equation to 0 at the beginning of each loop but this didnt help?? I wont bother posting the results because they are each 1000 entry long text files, but they change slightly everytime!? Any ideas would be greatly appreciated?? Thanks alot,
Ed Fraser CPP / C++ / C Code:
|
|
#2
|
||||
|
||||
|
Ed, welcome to GIDForums. Glad to see your code in tags. Really.
But, you have not declared a single variable in your code (c not c++). Some just need a little push: Quote:
CPP / C++ / C Code:
Quote:
Once you get to that point let us know what happens, Quote:
Well, you get the idea... __________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work." --Thomas Alva Edison "Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety." --Benjamin Franklin "A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes." --Hugh Downs Last edited by LuciWiz : 04-May-2005 at 00:15.
Reason: [Merging threads]
|
|
#3
|
|||
|
|||
Improved but still doesn't get repeated results!?!?!Hey, i've improved the program and added all the inlcude's etc... the program does the calculation fine and outputs it to a .txt file, although if i dont close the program and start it again, will give me different values everytime i do it. This makes me think i need to reset the values somehow but im not sure where or how?? Any ideas would be really great cause im ripping my hair out over it!!
Cheers, E D CPP / C++ / C Code:
|
|
#4
|
||||
|
||||
|
Read the Sticky. Take careful note of the guideline Do not start new threads on the same topic
And keep your hair on your side of the keyboard. I just found some in my soup Generally, reset your variables as you start your pass into the calculations portion of the code. Usually at the beginning of a loop. __________________
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough. -- Pearl Williams |
Recent GIDBlog
Writing a book by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Simulation Problem | wu_weidong | C++ Forum | 7 | 12-Mar-2005 23:56 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 16:13 |
| Re: Programming Techniques | WaltP | C Programming Language | 0 | 10-Mar-2004 00:56 |
| Search Engine Positioning 101 and 201 "How To" Tips... | 000 | Search Engine Optimization Forum | 0 | 29-May-2003 11:34 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The