To enable debugging of a release build, change the following release build options in VC++
1. On the Project menu, choose Settings.
2. Next to Settings for, select the configuration.
3. In the project tree, under Settings for, select a project.
4. Choose the C/C++ tab.
5. In the Category drop-down box, choose General.
6. In the Debug info drop-down box, choose Program Database.
7. In the Optimizations drop-down box, choose Disable (Debug).
8. On the Link tab, select the Generate Debug Info checkbox.
These selections correspond to the /Od and /Zi options, which turn off optimizations and place debug information in the build.
After doing this, rebuild and test your program. If the program works fine, it is still possible that you have a memory overwrite, but it is also possible that the optimizations are causing problems on a particular piece of code.
...........
thanks
bye
