程序使用VC++2010编译没有问题,运行也很正常,只是因为你的main函数的while循环没有中断条件,导致无限制的运行。
The Microsoft run-time library supports American National Standards Institute (ANSI) C and UNIX C. In this documentation, references to UNIX include XENIX, other UNIX-like systems, and the POSIX subsystem in Windows 2000, Windows XP, Windows Server 2003, and Windows Vista. The description of each run-time library routine includes a compatibility section for the following targets.
ANSI
ISO C 95
Windows 2000
Windows XP
Windows Server 2003
Windows Vista
All run-time library routines included with this product are compatible with the Windows API.
这是msdn中有关C运行库函数兼容性的一段说明,不保证兼容win98。vc6是98年的,可以说是基于win98的,所以_beginthread函数可能与之不兼容。尝试用api替代(CreateThread),或者试试_beginthreadex,或者参考下vc6的msdn。