Qfwfq Posted May 30, 2006 Report Posted May 30, 2006 Wow! After hours of painful troubleshooting today, I solved the above mystery, it was the age-old copy-paste effect!A colleague of mine always says: "If it were up to me, I'd deduct a few cents of pay for each copy-paste a programmer does in writing code!" and he does have a point. :hammer: What I discovered was that the cause of hard crashes in a new job I've done, which uses that job and when I did some optimizing, was the same cause of the wrong calculations back then. The hard crashed prevented all the debug logging and stuff, it was the "just compile and recompile" method... :xx: It turned out that, with a hurried copy and modify to save typing, I had unwittingly aliased RES and DRES :doh: but the use of the variable c in the final version was making DRES redundant except for clarity, so that deallocation of DRES was really deallocation of RES. The new job repeats calls to the old one and, when I tried refactoring it to avoid repetiton of initial and final stuff, including allocation and deallocation of RES, the result was disaster! :D Quote
alexander Posted June 1, 2006 Report Posted June 1, 2006 :warped: lol dont you hate it when that happens? Quote
Qfwfq Posted June 5, 2006 Report Posted June 5, 2006 I've just become far too accustomed to the fancy IDEs I guess. All along I could have used the memory debugging by just addng a #define DEBUG_MEM and, also, last week I had forgotten I could run the thing from command line and have a printf here and there, instead of logging. Quote
Qfwfq Posted August 3, 2006 Report Posted August 3, 2006 What will be the last value output, before the following program halts?#include "stdio.h" void main(){ for(double db=0; db<0.8; db+=0.1) printf("n%f", db); }:hihi: Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.