|
Answer» I wrote a C program, I DEBUGGED it and everything, and it worked fine. Then I created the executable and when I ran it, the program behaved differently than when it was in debugging mode. Then I took the executable on another PC, and when I ran it, it behaved like when it was still in debugging.
What can this be?
P.S. The part that behaved differently that I needed to print from an ARRAY of strings. On one PC it printed a certain string while on the other PC it printed another.I have only one answer. Are there any breakpoint you haven't remove? Having it work on one MACHINE and not the other to me indicates that the user input (from you or the system) was different for each system. Where they running the same OS?
FBI was taught 'C' on a course which a) every day would have us recite ".... error .... the RESULTS are undefined" b) reinforced this by using a time sharing mainframe that gave a core dump at every bug.
Typically 'C' compilers have option switches to control how well they examine the code and warn of errors / ambiguities, or whether the compiler should "help" by not warning, but making its "best guess" of what you meant.
Run time errors may involve illegal access outside the intended range of memory. Anything could affect the "undefined results", including the order of loading programs on different "victim" machines.
Regards Alan No I did not use any break points and they were running the same OS (both XP). I guess the problem is some memory leakage or something like that...
|