When I encounter software crash, the software always pop-up something like " The instruction at "0x1000a1eb" referenced memory at "0x000000c0". The memory could not be "read"".
Then Visual C++ will ask me whether to debug the program(in assembly).
My friend told me it is mostly cause by stack overflow. Is he right?
And is there any document on how to debug it?
The error message means the program is trying to read from a memory address that's not allocated to the program. That's a very common problem with a million possible causes. Usually it's caused by some sort of pointer that has run amok.
If it's your program, then compile it in debug mode, so the crash will launch the debugger and show you the offending line of source code. Hopefully the failed statement is in your code (because that's easier to debug) and not in some library or Windows function.