winconsole使用csting

来源:互联网 发布:js 取消input选中 编辑:程序博客网 时间:2024/05/01 11:01

VC8中是
cstringt.h     MFC-only   string   objects
  atlstr.h     Non-MFC   string   objects
 
VC6是
#include   <afx.h >   不过,还依赖其他文件,所以新建一个支持mfc的工程吧

 

使用win32控制台应用程序也能调通的啊,按Alt+F7,在C/C++的Category中选Code   Generation,然后Use   run-time   library选Multithreaded,然后我直接写的代码:
#include   <afx.h >
#include   <iostream.h >
#include   <time.h >
#include   <afxtempl.h >
void   main()
{
CString   MyString;
CTime   t=CTime::GetCurrentTime();
        cout < <t.GetYear() < <endl < <t.GetDayOfWeek()                                    
< <endl < <t.GetTime() < <endl < <t.GetGmtTm()- >tm_year < <endl;
MyString=t.Format("%A,   %B   %d,   %Y");    
                                                                         
cout < <t.GetLocalTm()- >tm_year < <endl < <MyString;
}
也能运行的。 
 

原创粉丝点击