在C++中需要取得系统时间,可以直接用c中的函数调用取得时间。
void CYttyDlg::OnButton7()
{
// TODO: Add your control notification handler code here
int s=time((time_t *)NULL);
CString aa;
aa.Format("%d",s);
AfxMessageBox(aa);
}
还有很多情况下可以直接调用c语言的函数,屡试不爽。
void CYttyDlg::OnButton7()
{
// TODO: Add your control notification handler code here
int s=time((time_t *)NULL);
CString aa;
aa.Format("%d",s);
AfxMessageBox(aa);
}
还有很多情况下可以直接调用c语言的函数,屡试不爽。
博客介绍了在C++中获取系统时间的方法,可直接调用C语言的函数。文中给出了具体代码示例,展示了如何在C++里通过调用C函数获取系统时间并输出,还指出很多情况下C++可直接调用C函数。
1128

被折叠的 条评论
为什么被折叠?



