请问vc6这种问题怎样才能快速的发现和定位?
下面的程序wsprintf函数的使用错误,但是在编译时没有任何错误提示信息,在运行中报"Unhandled exception in hello.exe(USER32.DLL):0xC0000005:Access Violation"的错误,并定位到一大堆汇编语言中。这个错误是我在一个较大的程序中犯的,因此当时花了相当大的精力把bug找出来,请问这种错误能够通过什么方法快速查找和定位出来吗?
开发环境是:vc 6,sdk
#include <windows.h>
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
char sbuf[100];
wsprintf(sbuf,"%3s",'a');
return 0 ;
}