没脾气2x:
C++Builder console 程序问题:
[阅读: 503] 2006-05-30 05:36:15
做了一个 console 程序如下:
int main(int argc, char* argv[])
{
while(true)
{
Sleep(50);
}
}
编译后运行。
运行过程中按 Ctrl+C 会报内存无法访问的错误:
ConsoleApp.exe - Application Error
The instruction at "0x40008f98" referenced memory at "0x00d448d8". The memory could not be "read"
Click on OK to terminate the program
后来发现把
Project->Options->Packages->Build with runtime packages 和
Project->Options->Linker->Use dynamic RTL
这两个选项任何一个去掉,再按 Ctrl+C 就没有错误了。
这是为啥呀。