FAQs about bugs and debugging.
Your program compiles, links, and runs without error messages, but...
My program appears to be running, but the output isn't right, and sometimes it does something weird. What's wrong?
No telling! Time to debug your program.
Read How to Debug.
My computer or program crashes or hangs with a message about "illegal memory access", "access violation", "segmentation fault", "unmapped memory", "bus error", "memory could not be read", or "memory could not be written". Help!
Some of my variables and strings are changing value all by themselves! Am I going crazy?
My program crashes at a certain place, but I am positive that there is nothing wrong with that code - it doesn't even use any pointers or arrays!
My program works fine except when it reads "Barney Google" from the input file - this doesn't make any sense!
When my program crashes, it does something different every time! I thought computers were predictable!
These are all symptoms of misaddressing memory with overflowed arrays or wild pointers, a *very* common bug in C/C++ programming. Read more details about the above questions in: Array and Pointer Bugs.
OK, how did my program misaddress memory?
How can I find misaddressing bugs?