This is part of a program I am writing. This part of the code is responsible for computing commulative stresses and strains. The problem here is that the first part of the code works fine (as far as I can tell) but when it reaches the loop segment below it stops functioning and the compiler (code::blocks on Win XP) gives me this error:
Process terminated with status -1073741510 (0 minutes, 10 seconds)
I tried putting a "cout" statement inside this loop but it wouldn't execute. Nothing inside this loops seems to function. This is the problematic part of the code:
I bet it never gets past line 12. You have an infinite loop.
On the 1st iteration line 3 il=0. 1st iteration in for loop on line 9 makes ll=0.
Line 12 tests if ll == il and it does since 0 == 0 so execution goes to line 7. ll and il remain 0 forever.
That'll still do the same thing though. It'll just run a bit more code before it gets to this line if (l1 == i1) {goto loop1;}
which is causing the infinate loop as fun2code said.
If you use the debugger to step though the code and look at the vaues of il and ll you'll see what is happening. (but I don't know how to step through code using code blocks)
Ok I removed the goto statement altogether and tried printing some values from the equations (results of resultuy [xx1] for example) but now the values I am getting are all gibrish (mixture of numbers and letters)...
Can anyone tell me what's wrong with it and why am I not getting any results but an error message instead. This is the error message: Process terminated with status -1073741819 (0 minutes, 11 seconds).
Do you need to add code to reset these variables when you go to next1 ? xx1 = 0, qq1 = 0, contactpnt1 = 0
Again, I'd say use the debugger to watch the values of the variables in your code when it's running, sorry I don't know what key to press for code:blocks but look for an option called "step" or "Set breakpoint"
Alternativley, at around line 94, write some code that prints out the values in xx1,contactpnt1,l1,i1,qq1 and then waits for a keypress. You can then look at the values and see if they are what you expect as the program runs.