Quote Originally Posted by Alterah View Post
I am wondering if anyone knows of something within C++ that could cause this kind of behavior.
That "something within C++" is called "undefined behaviour". If your program has bugs, there is no guarantee that the bug will expose itself to you when you run your program.

Unlike other languages, bad C++ coding does not guarantee that your program will crash. The code could keep running for years without any indication there is something wrong lurking underneath the hood. Bad C++ coding will not guarantee that your program will work on your friend's computer, even if it works on your computer, or if it will work on machine 10,001 even if it works on 10,000 previous machines, etc.

In your case, probably, when you run your program, that program is loaded in memory at a different location than when you run it under another a debugging environment. That different location may expose the bug or hide it.
Thanks, and let me know if you want my entire code.
Any runtime issue requires you to show the code that is being executed. Since no one knows what "add()" does, it requires you to show that code, and any code from those other functions we don't know. We also need to know what those headers contain that we don't know about.

In addition to code, we need to know what data you used to duplicate the problem.

Regards,

Paul McKenzie