下面的程序能运行出结果,但只是瞬间的显示就没了(时间很短),这是问什么?
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]){
int nRetCode = 0;
// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
_tprintf(_T("Fatal Error: MFC initialization failed\n"));
nRetCode = 1;
}
else
{
// TODO: code your application's behavior here.
CFile file(_T("\\VC教程\\SIO.txt"),CFile::modeReadWrite);
DWORD m_nLen=file.GetLength();
char str[80];
file.Read(&str,m_nLen);
for(int i=0;i<m_nLen;i++)
cout<<str[i];
cout<<endl;
file.Close();
}
return nRetCode;
}
程序运行完出现一个黑底色的对话框,显示出SIO文档的字符串。但是瞬间就没了,怎么让它长时间显示?